You are on page 1of 3

DOS COMMANDS

1) CD (CHANGE DIRECTORY): This command is used to change the present working directory. Using this
command we can jump from one directory to another directory.
Let, you are in drive D: and you want to go from games folder to movies folder so you use this command:-
D:\Games
D:\Games>CD Movies
D:\Movies

2) MD OR MKDIR (MAKE DIRECTORY): This command is used to make a subdirectory/subfolder in a present


working directory/folder.
Let, you are in drive D: and you want to create GTA folder in Games folder so you use this command:-
D:\Games>
D:\Games>MD GTA
New folder of name GTA will be created inside Games folder.

3) RD OR RMDIR (REMOVE DIRECTORY): This command is used to delete a subdirectory/subfolder in a


present working directory/folder.
Let, you are in drive D: and you want to delete GTA folder in Games folder so you use this command:-
D:\Games>
D:\Games>RD GTA
Folder of name GTA will be deletes, if it is inside Games folder.

4) DIR (DIRECTORY): This command is used to show the list of the files and folders in the present working
directory.
Let, you are in drive D: and DIR command will show you all files and subfolders in it.
D:\Games>
D:\Games>DIR

5) WILDCARDS IN DIR: Sometimes we want to search for a certain file, based on a known property of the
file name. So we need wildcards * and ? to find some file.
➢ * is used to donate any number of characters
➢ ? is used to donate exactly one missing character

1
DOS COMMANDS

6) DEL (ERASE): It is very useful but dangerous command provided by DOS. It is used to delete files from
disk.
It ask you are your sure to delete the data in a particular file. Press Y for yes and N for no.

7) DATE: This command is used to show you the current date and if you are administrator it also allows you
to change it.
8) TIME: This command is used to show you the current time and if you are administrator it also allows you
to change it.
9) VER: This command shows you the current version of DOS in which you are working in.

10) DISKCOPY: This command is used to make a copy of the floppy disk and this command is not used for
hard disk. Syntax: DISKCOPY source destination
Example: DISKCOPY A: B:

2
DOS COMMANDS

11) TYPE: This command is used to display the content of text file on the screen.

12) FORMAT: This command creates a new root directory like hard disk partition and creates file allocation
table for disk. It also check bad sectors on the disk and delete all the data on the disk.
C:\>FORMAT D:
It will delete all the data from D: drive partition of hard disk.
13) SYS: This command is used to transfer the MS-DOS hidden files to the disk specified on a command
prompt.

14) DELTREE: This command is used to delete all the directories and subdirectories even if the directories
are empty or not. Unlike RD command that delete the directory or subdirectory only if they are empty.
C:\>DELTREE C:\Users

15) XCOPY: This command is used to copy all directories and subdirectories and all other files except hidden
files and system files.
C:\> XCOPY C:\Data D:\Data

16) CHKDSK: This disk is used to checks the status of a disk and to fix errors of the disk.
C:\>CHKDSK D:

17) VOL: This command is used to display the disk label, serial number and volume, if they exist.

18) TREE: This command displays the folder structure of a drive or a specified path.
C:\>PATH C:

You might also like