DOS (Disk Operation System) is a tool which allows you to control the operation of the IBM PC. DOS is software which was written to control hardware. Here is a summary of some essential DOS commands.
To change the default drive indicated at the DOS prompt, type the letter of the drive followed by a colon (:). For example, to change the drive from "
X" to "
X:\> Y: [enter]
Use the CHDIR (CD) command to change the directory. For example, to change the directory from "
C:\Programs\folder" to "
C:\Programs\folder> cd D:\arcade\folder [enter]
Then, to navigate to "
digdug", a subdirectory of "
D:\arcade\folder> cd digdug [enter]
.." navigates to the parent directory (i.e., up one level), while "
\" navigates to the root directory (typically the
To copy a files or directories in DOS, it is necessary to use the "
copy" command. The default drive indicated in the DOS propmpt is of no concern when copying an item. Files or folders may be copied from anywhere to anywhere, regardless of the prompt drive. For example, to copy the file, "
pacman.exe" from the directory "
D:\arcade" to the directory "
C:\programs" (notice that the location indicated for the DOS prompt is different from both the source directory and the copy directory):
C:\different\> copy D:\arcade\pacman.exe C:\programs [enter]
Here, we repeat the previous copy command, while simultaneously renaming the file to "
C:\different\> copy D:\arcade\pacman.exe C:\programs\ms-pacman.exe [enter]
copy command may be generalized as follows:
[prompt location]\> copy [source item] [target location][\optional rename] [enter]
List Directory Contents
dir (directory) command to list the contents of a directory. File names and their corresponding sizes will be displayed. For example, to list the contents of the
X:\> dir C: [enter]
Similarly, to list the contents of any directory, "
X:\> dir C:\any\dir [enter]
Likewise, to list the contents of any subdirectory of
X (i.e., the current location as indicated in the DOS prompt):
X:\> dir \sub\dir [enter]
Here are some more hot
X:\> dir [enter] (lists contents of current directory,
X:\> dir /w [enter] (lists contents of current directory in wide format)
X:\> dir /w /p [enter] (lists contents of current directory in wide format, one screen at a time)
X:\> dir Y:*.txt [enter] (lists all .txt files on drive
X:\> dir Y:*.t?? [enter] (lists all files with extension beginning with "t")
To delete an item, use the deadly "
erase" command. For example, if you want to delete the file, "
terminated.jpg", located on the
X:\> erase Y:terminated.jpg [enter]
To delete a file within the directory indicated in the DOS prompt, no additional directory information is needed:
X:\> erase terminated.jpg [enter]
If you would like to erase all of the contents of a directory, say,
X:\> erase Y:*.* [enter]
To format a drive, use the "
format" command. Formatting a disk involves error checking and directory creation. For example, if you want to format the floppy disk in drive
A (note: disk formatting requires user input regarding several options presented during the process):
X:\> format A: [enter]
Create a Directory
To create a new directory, use the "
mkdir" command. For example, to create a directory called "
rygar" within the
X:\> mkdir Y:\arcade:rygar [enter]
This is even easier if you wish to create a directory within the current directory (i.e., the directory listed in the DOS prompt). For example, to create a
rygar directory within the
Y:\arcade directory while in
Y:\arcade> mkdir rygar [enter]
To rename an item, use the "
ren" command. For example, to rename the file "
atari.exe" to "
X:\> ren Y:\arcade\atari.exe nintendo.exe [enter]
Reboot the Computer
To reboot the computer while in DOS, use everybody’s favorite command:
[del] (control-alt-delete). For example, to reboot your system after making a mess of things, simultaneously press the three keyboard buttons,
Remove a Directory
To remove any empty directory, use the "
rd" command. For example, let’s remove the empty directory,
rygar, located within the directory,
X:\> rd Y:\arcade\rygar [enter]
Likewise, to remove
rygar when the current directory is the parent directory:
Y:\arcade> rd rygar [enter]
Terminate a Command
To stop the execution of a command before it has completed, press
[Break] (control-break) simultaneously. The somewhat-obscure
Break key is typically located near the
Scroll Lock and
Print Screen keys. Who knew it.
Change the Date
To change the system date simply type "date" and enter the desired date according to the format specified at the prompt.
Change the Time
To change the system time simply type "time" and enter the desired time according to the format specified at the prompt.
Return to Windows
To exit DOS mode and return to Windows, type "windows" at the DOS command prompt.
To exit DOS, type "exit" at the DOS prompt.