California Institute of the Arts , Network Services


DOS BASICS

A Little Bit of Knowledge can be a Dangerous Thing

What is DOS ?

DOS stands for Disk Operating System. It is the software that communicates with the hardware of your computer. An operating system is a collection of programs that provide services to other (application) programs so that the applications do not have to include the code to do these operations. Some of these services include how to handle the display, keyboard, printer, floppy and hard disk drives, and memory (RAM). You may think that DOS has disappeared but it hasn't. You will find it hiding under Windows 3.1, Windows95 and Windows98. Everything you can do with a GUI (Graphical User Interface) you can do at the DOS (or command) prompt, and more. It is a wonderful troubleshooting tool. Dismiss it to your own detriment.

The Prompt

The DOS prompt, also know as the command prompt, is the C:\>_ (or A:\>_ or B:\>_ or D:\>_ ) you have seen at some time or another. It can also look like I:\USERS\PAT>_ or A:\DOS>_. The prompt can be made to appear differently than this, but this is how it will look on 99% of the computers you will use.
All commands are typed at the DOS prompt. Basically, it is there to let you know, or prompt you that the computer is waiting for your input, waiting for you to tell it what to do. After you have typed a command at the prompt you have to press the enter key to let the computer know that you are done telling it what to do and that it should now act on your instructions. If you make a mistake in typing your command, you will get an error message and a new prompt. You will need to retype your command correctly to make the computer act.
This is a very fundamental way to interact with a computer and if you understand it you will better understand any other operating system such as Windows 3.1, Windows 95, Windows NT, Unix and even Macintosh.

Disk Drives and Drive Letters

Next lets take a look at the disk drive designations and the file structure. All drive designations are represented by a letter and a colon. Most computers have at least two disk drives, the floppy disk drive (removable) and the hard disk drive (non-removable). The floppy disk drive is represented by A: or B:. In fact, if you only have one floppy disk drive either letter will work.

The hard disk drive is always represented by C:. Usually that is the only drive letter associated with the hard disk drive. But a single hard disk drive can be divided up into smaller pieces and have other drive letters assigned to it such as D: and E:. Whatever the last drive letter used by the hard disk drive is, the next one would be assigned to your CDROM or ZIP drive if you have one.

For practice put a floppy in the floppy disk drive and change to it by typing A: at the prompt and pressing enter. Now change back to the hard disk drive by typing C: and pressing enter. Take the floppy out of the drive and type A:.You will get an error message. Try putting the floppy back in the floppy disk drive and try again.

If you have two floppy drives, one will be designated as A: and one will be designated as B:. If you look at the front of the computer as you press the enter key, you will see a light come on on the floppy disk drive as the computer tries to access it. This way you can tell which is the A: drive and which is the B: drive. Since this changes from computer to computer, it is good to know a quick way to check this.

Okay, now back to the hard drive. Type C: at the prompt and press enter. The drive letter displayed by the prompt is your current drive which in this case is the C drive.

The Directory Structure

Files are organized on a disk (floppy or hard) by the directory structure. It is often thought of as an upside down tree. The root of the directory structure is at the top. The root of a disk drive is represented by the \ (backslash). The "branches" or directories go down from there. There is even a command in DOS called TREE. This command displays the directory structure of the disk drive you are currently in. Try running TREE at the DOS prompt.

To move around in the directory structure use the command CD. CD stands for Change Directory. Now type CD\ and press enter. This will take you to the root of the C drive. If you type CD all by itself the computer will respond with the drive letter and directory you are in. This may seem redundant, because the prompt already shows this, but the prompt can be changed to show other things and you will run in to this.

Mother and Son

Any directory under the directory you are currently in is referred to as a subdirectory or a child directory. Any directory directly above the currect directory is referred to as the parent directory. Suppose we have the following directory structure:

\
RED      GREEN
BLUE         ORANGE

The directory structure gets wider as it goes down. Many liken it to an upside down tree. The root of the directory structure is represented by the backslash ( \ ). In the diagram above RED and GREEN are subdirectories of root. This makes the root the parent directory of RED and GREEN. RED and GREEN are the children of root. BLUE is a subdirectory (child) of the directory RED. RED is the parent directory of BLUE. If you are at the root (\) and you want to change to the RED directory, you would type CD RED. To change back to the root directory type CD\. To get to the BLUE directory from the root type CD RED\BLUE.

Now lets navigate to the ORANGE directory from the BLUE directory. You could first type CD\. This takes you up to the root of the drive. Now type CD GREEN\ORANGE. This command takes you down to the ORANGE directory. You could have typed CD\GREEN to move to the GREEN directory, and then typed CD\ORANGE to get there. OR you could have typed CD\GREEN\ORANGE all in one command. This would accomplish the same thing in one command as opposed to two or more commands, but they would all get you to the same place.

A couple of points that are important to emphasize. There is no other way to represent the root of a drive other than the backslash. In any command where you mean the root, you will type a backslash. There are two special directory representations that can be used in many commands. They are

the single dot .
the double dot ..

They represent the current directory ( . ) and the parent directory ( .. ). If you were in the ORANGE directory and wanted to go up one level in the directory structure, you would type

CD..

This would be true if you now wanted to go to the parent of the GREEN directory, which in this case is the root directory. The command

CD..

will take you up one directory. You may have noticed that when you use the backslash ( \ ), or the single dot ( . ), or the double dot ( .. ), that you do not NEED to put a space after the command CD. So the command

CD\
CD \

both work and will both take you up to the root of the drive. These two commands

CD..
CD ..

will take you up one directory level. But in every other case there must be a space between the command and any qualifiers (arguments) specified on the command line. Now, when you look at the directory structure with DOS commands, it will not give you the graphical appearance you see above. If you type the DIR command the output will look something like this..

Volume in Drive C is DOS622
Volume Serial Number is 0450-B256
Directory of C:\

.	<DIR>
..	<DIR>
GREEN	<DIR>
RED	<DIR>
COMMAND	COM	234,184	06-22-93
BK  EXE		 85,302	08-05-91
BK  TXT		  4,123	08-05-91
README  TXT	  1,258	08-31-91

	5 file(s)	 90,563 bytes
			289,891 bytes free

The command TREE lets you see the directory structure of the drive.
This is a work in process. Please check back for more.


TOP     HOME

Last updated 14 April 1999 by:
Karyn Williams Witt, CNE (karyn@calarts.edu)