Directory Related Commands
Listing files in a Directory
The DIR command is used to output a list of the contents of the current directory to the screen.
Eg: DIR
If you want to list files in another directory or on another drive you need to type the DIR
command followed by the location.
Eg:DIR A: list files in A drive
Switches with DIR Command
DIR/P
This command is used to pause and display one page offiles at a time. After every screen
youwill get a message "press any key to continue"..
DIR/W
This command list directory in a wide format., i. e. five filenames per line with no details.
DIR/S
This command is used to view the contents of the subdirectories present in the directory.
Making a new Directory
Use the MKDIR or MD command to make a new subdirectory.
Syntax: MD<directory name>
Eg:To make a new subdirectory called STUDENT under your current directory you simply type:
MD STUDENT(ENTER)
Removing a Subdirectory
Use the RMDIR or RD command to delete a subdirectory. Before you run RD, keep in mind the
following points:
● You can only remove a subdirectory, if it contains no files or subdirectories.
● You can only remove one subdirectory at a time.
● You cannot remove the root directory.
● You cannot remove the current directory, you must first empty it, and then move out to its
parent directory to remove it.
Eg: to remove the subdirectory called STUDENT, type RD STUDENT
Changing from one Directory to Another
Use the CHIDIR or CD command to change from the current directory to one in which you
want to work
Syntax CD directory path
Eg: to change to a directory called PGDCA, type CD PGDCA (ENTER)
If PGDCA were a subdirectory of the STUDENT directory you would type
CD/STUDENT/PGDCA (ENTER)
To change to the root directory from anydirectory or subdirectory type CD/(ENTER)
To change to the parent directory of your current directory type CD…(ENTER)
Windows XP/2000
Windows XP is an Operating System that controls your computer's hardware. Computer
hardware is not capable of communicating to you directly by itself. It needs a communication
medium to understand your requirements. Such a medium is called the Operating System. The
operating System controls the overall working of your computer. It helps you manage files, and
check the various peripheral devices such as the printer, monitor, mouse etc. DOS is also an
Listing files in a Directory
The DIR command is used to output a list of the contents of the current directory to the screen.
Eg: DIR
If you want to list files in another directory or on another drive you need to type the DIR
command followed by the location.
Eg:DIR A: list files in A drive
Switches with DIR Command
DIR/P
This command is used to pause and display one page offiles at a time. After every screen
youwill get a message "press any key to continue"..
DIR/W
This command list directory in a wide format., i. e. five filenames per line with no details.
DIR/S
This command is used to view the contents of the subdirectories present in the directory.
Making a new Directory
Use the MKDIR or MD command to make a new subdirectory.
Syntax: MD<directory name>
Eg:To make a new subdirectory called STUDENT under your current directory you simply type:
MD STUDENT(ENTER)
Removing a Subdirectory
Use the RMDIR or RD command to delete a subdirectory. Before you run RD, keep in mind the
following points:
● You can only remove a subdirectory, if it contains no files or subdirectories.
● You can only remove one subdirectory at a time.
● You cannot remove the root directory.
● You cannot remove the current directory, you must first empty it, and then move out to its
parent directory to remove it.
Eg: to remove the subdirectory called STUDENT, type RD STUDENT
Changing from one Directory to Another
Use the CHIDIR or CD command to change from the current directory to one in which you
want to work
Syntax CD directory path
Eg: to change to a directory called PGDCA, type CD PGDCA (ENTER)
If PGDCA were a subdirectory of the STUDENT directory you would type
CD/STUDENT/PGDCA (ENTER)
To change to the root directory from anydirectory or subdirectory type CD/(ENTER)
To change to the parent directory of your current directory type CD…(ENTER)
Windows XP/2000
Windows XP is an Operating System that controls your computer's hardware. Computer
hardware is not capable of communicating to you directly by itself. It needs a communication
medium to understand your requirements. Such a medium is called the Operating System. The
operating System controls the overall working of your computer. It helps you manage files, and
check the various peripheral devices such as the printer, monitor, mouse etc. DOS is also an