There are mainly two types of DOS Commands. They are Internal DOS Commands and External DOS Commands. Any file having file extension as .COM or .EXE or .BAT is known as external DOS commands which are on the disk as program files. Similarly, internal DOS commands are built-in to DOS which performs quickly and do not require any disk drive.
Some of the examples of internal DOS commands are BREAK, CLS, EXIT, DATE, TIME, DIR, etc.
Why DOS Commands are used? There are many uses of DOS commands. It is used to execute programs, checking disk errors, restoring file on the disk and much more. Also, it is used to copy or compare or rename files, formatting disk, setting time and date, etc.
Important MS-DOS Commands with their Syntax
1. ATTRIB- It displays file attributes. The syntax for ATTRIB is ATTRIB [+R/-R] [+A/-A] [+S/-S] [+H/-H] [[drive:] [path] file-name] [/S].2. BACKUP- This command is used for storing files for future use. The syntax for BACKUP command is BACKUP source destination-drive: [/S] [/M] [/A] [/F[:size]] [/D:date[/T:time]] [/L[:[drive:] [path] log-file]].
3. BREAK- It is used in CONFIG.SYS file. The syntax for BREAK internal command is BREAK [ON\OFF].
4. CHKDSK- This command is used to display a status report for any disk. The syntax used for this command is CHKDSK [drive:] [[path] filename] [/F] [/V].
5. CLS- It is used to clear the screen. The syntax is CLS.
6. DATE- This command is used to display a date. Also, it can be used to modify the date. The syntax is DATE [date].
7. DEL- This DOS command is used to erase a file. The syntax for DEL command is DEL [drive:] [path] filename.
8. DIR- This command is used to display files or directories. The syntax is DIR [drive:] [path] [file-name] [/P] [/W] [A:attributes] [/S].
9. LABEL- This DOS command is used to display the drive volume label. The required syntax is LABEL [drive:] [label].
10. MD- This command is used to make a new directory. The syntax is MD [drive:]path.
11. RD- This command is used to remove an existing directory. The syntax is RD [drive:]path.
12. PATH- This command is used to show the directory for required files. The syntax for this command is PATH [drive:]path.
13. REN- This DOS command is used to rename the existing file. The required syntax is REN [drive:] [path]old-file new-file.
14. RESTORE- This command is used for restoring files. The syntax is RESTORE <drive1:> <drive2:> [path[file-name] [/s] [/p].
15. TIME- This command is used to display the recent time. Also, it is used to modify the system time. The syntax for TIME command is TIME [HH:MM:SS.xx].
16. TYPE- It is used to display various sorts of the file. The syntax is TYPE [drive:] [path]file-name.
17. VOL- It is used to display the volume label of the drive. The syntax for VOL command is VOL [drive:].