DOS (Disk Operating System) uses a command-line interface (CLI) to perform file, directory, and system management tasks. Below are essential DOS commands with examples.
Opening Command Prompt (CMD)
- Press Win + R, type cmd, and press Enter.
- Or, search for Command Prompt in the Start menu.
File & Directory Commands
Command | Description | Example |
---|
dir | Lists files & folders | dir C:\Users |
cd | Changes directory | cd Documents |
cd.. | Moves up one directory | cd.. |
md or mkdir | Creates a new folder | mkdir NewFolder |
rd or rmdir | Deletes a folder | rmdir OldFolder |
del | Deletes a file | del file.txt |
copy | Copies a file | copy file1.txt D:\Backup |
move | Moves or renames a file | move file1.txt D:\Documents |
ren | Renames a file | ren oldname.txt newname.txt |
System & Disk Commands
Command | Description | Example |
cls | Clears the screen | cls |
time | Displays or changes system time | time |
date | Displays or changes system date | date |
ver | Shows DOS version | ver |
vol | Displays disk volume name | vol C: |
chkdsk | Checks disk for errors | chkdsk C: |
format | Formats a disk drive | format D: |
exit | Closes command prompt | exit |
Viewing & Editing Files
Command | Description | Example |
type | Displays file contents | type file.txt |
edit | Opens a file editor (old DOS) | edit file.txt |
notepad | Opens file in Notepad | notepad file.txt |