DOS Commands

Basic DOS Commands :-

ATTRIBdisplays or changes file attributes
CHDIR or​ CDdisplays the name of the current directory or changes the current directory
CHKDSKchecks the status of a disk and displays a status report; it can also fix disk errors
CLSclears the screen
COPYcopies one or more files to a destination you specify
DELdeletes the files you specify
DELTREIEdeletes a directory and all the files and subdirectories that are in it
DIRdisplays the files and subdirectories that are in the directory you specify
DISKCOPYcopies the entire contents of one floppy disk to another floppy disk. It writes over the existing contents of the destination disk as it copies the new information on it.
ECHOdisplays or hides the text in batch programs when the program is running.
EDITstarts MS-DOS Editor, a text editor you can use to create and edit ASCII text files.
DEL or​ ERASEdeletes the files you specify
EXITquits the MS-DOS command interpreter and returns to the program that started it, if one exists.
FASTHELPdisplays a list of all MS-DOS 6 commands and gives a short explanation of each.
FINDsearches for a specific string of text in a file or files
FORMATformats a disk for use with MS-DOS
HELPstarts MS-DOS Help
MKDIR or​ MDcreates a directory
MEMdisplays the amount of used and free memory on your computer
MOREdisplays one screen of output at a time
MOVEmoves one or more files to the location you specify
MSBACKUPbacks up or restores one or more files from one disk onto another
MSDProvides technical information about your computer
PRINTprints a text file while you are using other MS-DOS commands
QBASICstarts MS-DOS Qbasic
RD or​ RMDIRdeletes a directory
RENchanges the name of the file or files you specify
RMDIR or​ RDdeletes a directory
SCANDISKstarts a disk analysis and repair tool that checks a drive for errors and corrects any problems that it finds.
TREIEgraphicaly displays the structure of a directory
UNDELETErestores files that were deleted previously by using the DEL command
VERdisplays the MS-DOS version number
XCOPYcopies directories , their subdirectories, and files except hidden and system files.

DOS commands

Command and UsageExamples
Change file attributes. ​+ adds an attribute, ​removes it. Attributes are: A=archive; R=read only; S=system; H=hidden.
ATTRIB -R -A -S -H <VIRUS.EXE> All these attributes will be removed from virus.exe.
Go to the C: drive. Similarly A: and D: etc.
Change directory.     When you change the directory, the prompt changes, showing the path of the directory you are currently in. Note, the directory is the term used by DOS for what Windows calls a folder.
CD\ takes you to the top of the directory tree (typically to C:).
CD.. ​moves you one level up the directory tree (i.e. up towards the root directory).
CD <DIRECTORYNAME> ​takes you to that directory. You can use one or more subdirectory names, separated by \ e.g. 
CD WINNT\Media ​takes you to the directory C:\WINNT\Media To change to another path, type the full path with slashes. e.g. 
Clear the screen.
Delete one or more files in the current directory. Can be used with the ​* and the ​? wildcards. DEL *.* ​will delete ALL files in the current directory, USE WITH CAUTION. (Note: DEL cannot be used to delete directories. Use RD to remove a directory.)
DEL <VIRUS.EXE> ​deletes virus.exe DEL *.JPG ​will delete all files with the extension JPG.
DEL MY*.* ​will delete all files beginning with MY and with any extension.
DEL MY??.* ​will delete files that are 4 characters long and begin with MY and with any extension.
Displays the contents of a directory (folder). Note, the directory is the term used by DOS for what Windows calls a folder.    
These switches can be combined, so DIR​    /W /P ​will return multiple rows listing a page at a time. You can use the ​* and the ​? wildcards to search for a particular file.
The ? character represents ONE character, and the * character represents multiple characters. DIR *.* ​lists all the files in a directory.
DIR ​displays all files and folders in the current directory. Folders are indicated in the list by <DIR>.
Files are usually listed by name. DIR /P ​displays the contents a page at a time, i.e. as many as will fit in your command line window. Press any key to display the next page. DIR /W ​displays the files/folders in multiple rows.
This view gives less information per file.
DIR *.JPG ​displays all files with the extension JPG in the current directory and all subdirectories.
DIR MY??.* ​displays all files beginning with MY, exactly 4 characters long, and with any extension.
DIR /S lists the contents of all subdirectories.
DIR /AH​ displays all hidden files.
Runs DOS EDIT (a simple text editor). Useful for editing batch files and viewing logs. This command requires QBASIC.EXE to be present.
EDIT <VIRUSLOG.TXT> ​opens the file viruslog.txt and allows you to edit it. EDIT <NEWFILE.TXT> ​creates a new file called newfile.txt and opens it up for you to edit.
Displays DOS Help. For help on an individual command, type HELP then the command for which you want more information.
HELP DIR displays information on the DIR command.
Make Directory creates a new directory below the current one. (The command can also be written as MKDIR​ ​.)
MD <NEWDIR> creates a new directory called Newdir.
Prints the specified file (if the printer is supported in DOS – many are not).
Remove directory. Removes a sub-directory of the current directory. The directory you want to remove must be empty of all files. (The command can also be written as RMDIR)
Rename a file. You must use the full file name including the suffix.
Displays the contents of a file on the screen. If you use this command on a file that is not a text file, the display will be unintelligible. Use with ​
MORE to display the text on a page-by-page basis, and prevent it from scrolling off the screen. ​|​ is a pipe character.
When you run a DOS command, the output is usually sent to the screen.
Use > to redirect output from the screen to a file.
It runs the command preceding the >, creates a file in the current directory with the name you specify, and sends the information/output returned by the command, to that file.
COMMAND > FILENAME.TXT e.g. SWEEP > REPORT.TXT The details of any infected files reported by SWEEP are sent to a file called REPORT.TXT.