DOS Cheat Sheet for Computer Tools for Engineers
Here is a short "cheat sheet" of DOS basics. You will need to
know this information to manage files on your floppy and hard-disk.
Basic concepts (files and directories):
A file contains data or a program and is stored in a directory.
A filename can have a maximum of 8 letters followed by a "." and
three more letters. For example, salary.mcd is a
MathCAD file, grades.xls is an Excel file, prog1.f
is a FORTRAN file, and prog1.exe is an executable file
(i.e., an application).
A directory is analogous to a file folder. Files are stored in
directories, The "root directory" on a PC hard-disk is
c:\. On a floppy disk the root directory is
a:\ or b:\.
Commands to manipulate files:
- copy x y - Copies file x to file y. Files x and y
can be specified with their disk and directory name. For
example, copy user.dat a:\kjc copies file
user.dat in the current directory to directory
\kjc on the floppy disk.
- erase x.dat - Erases file x.dat in the current
directory.
- rename x.dat x.old - Renames a file with name x.dat
to a file with name x.old in the current directory.
- dir - Lists all files in the current directory.
- prompt $p$g - Command to make the "DOS prompt"
indicate the current directory (e.g., as in c:\temp\>).
Commands to manipulate directories:
- md c:\x - Makes directory x as a "first
level" directory from the hard-disk root.
- cd c:\x - Changes to directory x from the
root. Note that cd c:\ will always get you back to the
hard-disk root directory.
- rd c:\x - Removes directory x from the
hard-disk root. The directory must first be empty (i.e., all
files erased).
Formatting a diskette:
Formatting a diskette "cleans" the diskette (erasing any files) and
prepares it for use. All brand new diskettes must be formatted.
The format command is:
- format a: - Formats the diskette in the a: drive.
- format a: /Q - Does a quick format.
When formatting is complete, you will be asked for a "volume name",
just press Enter.
Some simple examples (that also show some new things):
- Here is an example of copying all files from a floppy disk
(a:\) to an existing directory named c:\kjc on the
hard-disk...
- And now copying all of the MathCAD files only back to the
floppy disk...
- Here we format a floppy disk and create three directories...
format a:
md a:\proj1
md a:\proj2
md a:\proj3
- Here we create a directory, change to it, copy a file from
the floppy disk to this now "current" directory, erase the file,
change back to the root directory, and finally remove the created
directory.
cd c:\
md c:\kjc
cd c:\kjc
copy a:\xxx.dat c:\kjc
erase xxx.dat
cd c:\
rd c:\kjc
- Here we copy all files from a floppy disk (that has no
directories other than the root directory) to c:\. Then
we copy the files back to another diskette. This is an example
of how you can back-up the files on your diskette.
cd c:\
md c:\temp
copy a:\*.* c:\temp
Remove floppy disk and replace with another floppy disk.
copy c:\temp\*.* a:\
[Return to EGN 2210 Home Page]
Last updated by
Ken Christensen on AUGUST 12, 1999