In the picture to the right is an example of the tree command output that shows all the local and subdirectories (e.g. the "big" directory in the cdn directory). When looking at this overview, the C: drive is considered the current directory and root directory because there is nothing beneath it and you can't go back any further. If you are using an operating system with multiple user accounts the directory may also be referred to as a home directory.
Overview of a directory and path
Below is an example of what a directory path would look like in MS-DOS.
Overview of a Linux directory path
Below is an example of what a directory path may look like in a Linux or Unix variant.
In the above example, the current directory is bin, and it is a subdirectory of the usr directory. The beginning forward slash is the root directory.
How do I list or view directories?
To see directories and files in the current MS-DOS directory use the dir command. In Linux to view directories and files in the current directory, you'd use the ls command.
- See the dir command page for further information and examples on this command.
- See the ls command page for information and examples on this command.
Tip: Both of the above commands also have switches that can be added to them to only view directories and not directories and files.
How to change a directory
To change a directory in MS-DOS, Linux, Unix, and most other command line operating systems, use the "cd" command.
- How do I change directories?
- How do I change or rename the name of a file or folder?
- MS-DOS and Windows command line cd command information.
- Linux and Unix cd command information.
How to make a directory
To make a directory in MS-DOS, Linux, Unix, and most other command line operating systems, use the "mkdir" command.
- MS-DOS and Windows command line mkdir and md command information
- Linux and Unix mkdir command information
- How to create a directory or folder.
How to delete a directory
To remove a directory in MS-DOS, use the "rmdir" command. In Linux and Unix, use the "rm -r" command.
- How do I delete a file, directory, or folder?
- MS-DOS and Windows command line rmdir information
- Linux and Unix rm -r command information
What type of files can be stored in a directory?
A directory can contain any type of file and can even store other directories with their own files.
Invalid directory characters
Below is a listing of reserved characters that cannot be used when creating a file or directory on most operating systems. When creating directories, if any of these characters are used, you'll receive an error or encounter other problems.
\ / : * ? " < > |
Also see: Absolute path, Change directory, Current directory, File, Folder, Hierarchical file system, Home directory, Mkdir, MRUD, Network directory, Operating system terms, Parent, Path, PWD, Root directory, Shared directory, Subdirectory, Wd