Introduction:
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 -
1
Basic of Command Prompt:
2
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.
3
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.
Options | Description |
---|---|
/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.
4
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
5
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.
mkdir folder1
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.
mkdir G:\Directory\Sub-Directory-2\folder2
Above command will create New directory named folder2 at G-drive » Directory » Sub-Directory-2
.6
Delete Directories:
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.
rmdir folder1
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.
rmdir G:\Directory\Sub-Directory-2\folder2
Above command will delete directory named folder2 from location G-drive » Directory » Sub-Directory-2
.