In Computing, a directory also known as a Folder or Drawers is a file system cataloging structure which contains references to other computer files, and possibly other directories.
Files are organized by storing related files in the same directory. A directory contained inside another directory is called a Subdirectory. We use the terms "Parent" for Directory and "Child" for subdirectory to describe the relationship between a directory and subdirectory in which it is cataloged. The top-most directory in such a filesystem, which does not have a parent of its own is known as root directory.
Quick Summary: We are going to Learn -
» Basics of Command Prompt
» Current Directories
» Listing the Current Directories
» Changing Directories
» Create New Directory
» Delete Directory
Basic of Command Prompt:
When we open the command prompt, a message similar to the above picture appears.
1 » The first line shows the Window version that we have installed.
2 » The second line shows the copyright statement.
3 » The third line is Blank.
4 » The fourth line is the prompt, or command prompt. It shows our current location in the system - Root » Directory » Sub-Directory. A blinking prompt follows and this is where you can begin entering commands.
Working with Current Directories:
The current directory, also known as the working directory, is where we are. In window environment, this is equivalent to having a window open and viewing the files. To know the current directory, type chdir or cd after the prompt and press enter. both command will display the current working directory.
Listing the Current Directories:
To see what is contained in the current directory, we can use a directory list command dir with the following additional options.
|/a||Displays files with specified attributes.|
|/t:w||Indicates the output should display the time and files were last written.|
|/s||List recursively through all directories and files within the current directory.|
|/p||Indicates that the output should display one page at a time.|
There are many more option to use with dir command. type Help dir in command prompt to get the complete list of options.
Changing Directories from current to other:
Now, we can know that what is the current directory and we may want to navigate to a different directory. To change the current directory, we use cd command as shown above in picture. using cd command, we are in Desktop directory, just like we double clicked on the Desktop folder. We can get a list of all the documents in the directory using dir command
Creating New Directories:
We can use the command prompt to create new directories in our window just like we create a new folder. The words directory and folder are often used interchangeably to identify organizational structures in a file system. We can create new directories to keep files or other directories in it. we use mkdir command along with the directory name to create new directory within the current working directory. consider the following examples:
1 » Create Directory within current working directory.
Above command will create New directory named folder1 within current working directory. Be sure you know where you are currently.
2» Create Directory at specific location.
Above command will create New directory named folder2 at G-drive » Directory » Sub-Directory-2.
We can use command prompt to Delete directories in our window just like we delete any folder. we use rmdir command along with the directory name to delete any directory. consider the following examples:
1 » Delete Directory from current working directory.
Above command will delete directory named folder1 from current working directory. Be sure you know where you are currently.
2» Delete Directory from specific location.
Above command will delete directory named folder2 from location G-drive » Directory » Sub-Directory-2.