You are on page 1of 3

Basic knowledge

 Press up arrow key for previous command.


 Press tab key the command processor searches for all files whose path (but not necessarily the
file name) matches your entry.

To start Command Prompt


cmd

To quit Command Prompt


exit

To display a listing of commands and brief explanation


Note: | more
help

Provide details explanations on a particular command


Note: help [command]
[command] /?

View or change the systems date


date

View or change the systems time


time

Easily change the background and foreground color of the MS-DOS window
Note: BG and FG
color
E.g. color 07

Displays the version of MS-DOS or if running Windows 95 or above the version of Windows
ver

Display the volume information about the designated drive


Note: [drive:]
vol
E.g. vol C:

To view a listing of files and folders in an easy to read listing


Note: [drive:\][path], /f
tree
E.g. tree C:\share

List the contents of one or more directory


Note: /w , /p, *.extension
dir
E.g. dir d:\share

To change / go to / switch to directories


Note: cd.. , cd\
cd
E.g. cd.. -> exit current sub folder
Allow the user to see the contents of a file in DOS window
Note: | more
type

To clear the complete contents of the screen and leave only a prompt
cls

To run an executable file


Note: Extension is optional
name_of_file

To create files of any extension


Note: file_name, CTRL+Z / F6
copy con
E.g. copy con test.txt
E.g. notepad test.txt

To create files of any extension


edit
To edit / modify files of any extension
Note: [name_of_file_with_extension]
edit
E.g. edit test.txt

To rename a file, folder of file extension


Note: [old_file] [new_file]
rename / ren
E.g. rename test.txt sample.txt

To copy / backup file(s) into new location


Note: [source] [destination], /y, /-y, *.extension
For multiple files copying , use “*.*”
To combine files (.txt), use “+”
copy
E.g. copy t*.txt C:\test
Copy all files in the current directory
E.g. copy *.*
Copy the contents in myfile2.txt and combines it with the contents in myfile1.txt.
E.g. copy myfile1.txt+myfile2.txt

To move / cut file(s) into new location


Note: [source] [destination], /y, /-y, *.extension
For multiple files moving, use “*.*”
move
E.g. move t*.txt C:\test
To remove file(s)
Note: /p, /a, *.extension
DEL *.* /AR would delete only read-only files
DEL *.* /AH deleted only hidden files
DEL *.* /AS removes only system files
DEL *.* /AA erases only archives files
DEL *.* /-H erases everything but hidden files
del, delete, erase
E.g. del /p test

To create directory (folder)


Note: [folder_name]
mkdir, md
E.g. md alpha\beta

To rename directory (folder)


Note: [old] [new]
ren
E.g. ren alpha omega

To remove directory / subdirectory


Note: /s, /q
The “RD” command only works when directory is empty
/s, /q switches only available in Windows 2000/ XP. For earlier version, use DELTREE
rmdir, rd
E.g. rd test /s

You might also like