A directory is a location for storing files on your computer. Directories are found in a hierarchical file system, such as DOS, OS/2, Unix, etc. When referring to a directory, a user commonly indicates the name of the directory.
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. This may also be referred to as a home directory if you're using an operating system with multiple accounts.
Below is an example of what a directory path would look like in MS-DOS.
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.
To change a directory in MS-DOS, Linux, Unix, and most other command line operating systems, use the "cd" command.
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
Below is a listing of reserved characters that cannot be used when creating a file or directory in most operating systems. When creating directories, if any of these characters are used, you'll receive an error or encounter other problems.
\ / : * ? " < > |
To delete a directory in MS-DOS, use the "rmdir" command. In Linux and Unix, use the "rm -r" command.
- How do I change directories?
- How do I determine the size of a file or folder?
- How to copy a directory or folder.
- How do I delete a file, directory, or folder?
- How do I change or rename the name of a file or folder?
- What is the difference between a directory and folder?
- How do I count how many files are in a folder?
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