MS-DOS


Operating Systems Unix Outline

MS-DOS®

In this overview of MS DOS, pronounced MESS DOS, things you should type at the C:\ > prompt appear like this. Work through the Q&A session skipping anything you are already familiar with. Use the question list to jump to the appropriate spot in the document.

More help is provide by these lists and links:


What do I do?

This document gives an introduction to the MS DOS operating system. The document is intended for new users of PCs.


So how do I do it?

This overview can be read on its own. In order to gain a better understanding of MS DOS you are advised to try out the commands described in the document.


Great, but what if I need more?

RTFM at this stage you may not be familiar with this well-known technical acronym - as you proceed you will find it repeated many times and the meaning will become clear.


MS-DOS is just one operating system, right?

This document describes the use of MS DOS version 5. The material is also valid for MS DOS version 6. Version 6.22 was the last true version of MS-DOS, the version provided with Windows 95 on is an "emulator" for the iold MS-DOS shell. A number of facilities described in this document (in particular, the full screen editor) are not available in earlier versions. You should type the MS DOS command:

C:\ > ver

to find out what version of MS DOS you are running. You will probably get a message like

Windows 95. [Version 4.00.950]


What is MS DOS?

MS DOS was the name of the operating system which was used on the majority of PCs. It is now a Windows command shell. The function of the operating system is to provide a means of interaction between the computer and the user. OS functions include:

Reading and interpreting commands.

Running commands, utilities and applications.

Managing the filesystem.

Most PCs now run a graphical user interface (or GUI) known as Microsoft Windows. Windows provides many of the functions previously available in MS DOS, and many people find it easier to use.


What is a Network?

Many PCs are connected to other more powerful computers that act as file servers using a network. Network software has a series of operating system commands associated with it; however these commands will not be described in this document. The network operating system is closely linked with the OS, and most MS DOS commands will work on both local and remote network filesystems.


How do I use MS DOS commands?

When you sit down in from of your PC you will normally see the MS DOS prompt, which looks something like:

C:\ > or H:\>

When you type an MS DOS command it is normally in the form:

C:\ > command [object] [options]

The command options and options (shown enclosed in square brackets above) are optional. For example:

H:\ > dir or C:\ > dir windows /p

are valid MS DOS commands. Note that options are normally preceeded by a forward slash (/) character. Also note that MS DOS commands and options can be in upper or lower case. In this document all commands will be displayed in lower case. Unlike UNIX, MS-DOS commands are not case sensitive.

Windows 95 allows long filenames (more than 8.3) which are not understood by MS-DOS. The MS-DOS shell in Windows understands these names if they are quoted.

C:\ > dir Program Files

is not understood by the Windows shell or true MS-DOS. But

C:\ > dir "Program Files"

is interpreted correctly by the Windows MS-DOS shell - but not by true MS-DOS!!


What are files?

On many computer systems information (such as papers and essays which are typed, graphics, lists of numbers and other data.) are stored as files. You can normally store your files in a directory: this is something similar to storing papers (files) in a folder (directory) in a filing cabinet.

MS DOS has a hierarchical, tree-like filestore. The top level directory is identified by the backslash (\) character. System and user files and directories are stored beneath the top level directory. The directory tree on a PC will look something like:

\
\dos
\tmp
\windows
   \system
   \msapps
\work

Please note that in MS DOS commands, directories are separated by the back slash character. For example:

\windows\system\sysedit.exe

This is in contrast to the UNIX operating system in which files and directories are separated by the forward slash (/) character. This a constant source of confusion and mistyping. Just remember compared to UNIX, MS-DOS is OS backward. It also "earned" Bill Gates $17 billion (not that I'm bitter).

Note: this was written in 1994 so the $17 billion is more like $70 now.....


What are disks?

Files and directories are stored on disks. Each disk is identified by a drive letter, a single character like "C". A standalone PC will normally have at least one hard disk. By convention, the first hard disk on the system is normally known as the C drive. The C drive will contain directories which contain system files, applications software as well as your own data files.

If the PC is attached to a computer network (such as the PCs in Room 141 to the campus Microsoft network) various network disk drives will also be available. System files and applications software are normally held on system disk drives (such as E, F and G). Your files are held on a separate drive, which is normally called H (for home).

As well as the disk drives mentioned above, many PCs can also read and write to floppy disks. The disk drive for floppy disks is located at the front of the PC system unit. Floppy disks can be 3.5" or 5.25" in size. There are usually designated A and B.

Disks are seen by the MS DOS filesystem as devices which can be read from or written to like any other file.


How do I create a directory?

In order to create a directory type:

C:\ > mkdir [dirname] or C:\ > md [dirname]

The directory name may be up to 8 characters in length. You should normally use only alphanumeric characters (e.g. A-Z and 0-9). (Windows allows longer file and directory names which may include other characters, MS-DOS will try to create a unique "alias" for such files.)

You are advised to create and use a directory for each related group of work topics. For example, if you are creating files for two separate projects, you could create two directories called proj1 and proj2.


How do I move from one directory to another?

When you are using MS DOS you will be located in a directory, which is known as your working directory. In order to change your working directory you will have to give the command:

C:\ > cd [dirname]

For example, to move to a directory called proj1 you would type:

C:\ > cd proj1

To move up a level towards root:

C:\PROJ1 > cd ..

You will notice that when you change your directory, the prompt will change to display the current working directory. Most PCs are configured to do this. (Typing prompt $p$g sets the prompt to show the current working directory.)


How do I change drives?

If you wish to use files on another disk drive:

C:\ > [drive:]

For example, to move to the A (floppy disk) drive you would type:

C:\ > A:

The prompt will change to display the new drive letter.


How do I display directory contents?

When you have created a number of directories and used applications software such as a word processor to create files, you will need to display the names of the files that are stored in your directories, and also display the contents of individual files.

If you wish to display a list of files stored in a directory, give the command:

C:\ > dir

A list of files and directories will be displayed on your screen. If the list is longer than about 24 lines the screen will scroll and the information at the top of the screen will disappear. If you wish the scrolling to stop you should press the <Ctrl S> keys. The screen display will be suspended until you press the <Ctrl Q> keys.

Another way of suspending the output is the command:

C:\ > dir /p

The display will stop when it reaches the bottom of the screen. You will have to press a key to continue the display - remember /p for page.


How do I display file contents?

To display the contents of a text file you should give the command:

C:\ > type [filename]

Please note that this command should only be used with plain text (also known as ASCII) files. If you use the command with a binary file (such as a word processing file) binary information will be displayed in the form of non-alphanumeric characters. This is not visually attractive. Certain characters may also cause the PC to "beep", "blank the video" and generally do bizarre things. Most users find this disconcerting. Programmers describe it as a feature.

How do I delete unwanted files and directories?

You should delete files and directories when you have finished with them. If you fail to delete files on a regular basis you will find that you will run out of file space and be unable to do any more work.

To delete a file give the command:

C:\ > del [filename]

To delete all files in the current directory give the command:

C:\ > del *.*

The * is called a wildcard character. It stands for any name.

If you wish to delete a directory give the command:

C:\ > rmdir [dirname] or C:\ > rd [dirname]

Please note that the directory must be empty before you can delete it.


How do I edit a text file?

A powerful full screen editor was supplied with MS DOS 5 and subsequent versions. The editor can be used for creating and editing text, program source code and data files. The MS DOS editor cannot be used for word processing - it cannot format characters (i.e. make them bold or italic).

To run the MS DOS editor:

C:\ > edit or C:\ > edit [filename]

Unlike editors that were supplied with early versions of MS DOS you do not need to memorise a large number of commands; all the commands you need to use are available from the menu bar, which is displayed at the top of the screen.

In order to use the menu bar, use the mouse to select an item or press the <Alt> key (which is normally located near the bottom of the keyboard, to the left of the space bar). You will notice that one letter of each of the menu options at the top of the screen is highlighted. Simply press the highlighted letter to display the relevant menu options.

To create a file using the editor simply type in your text. You can use the mouse and the scroll bars to move around the file. You should remember to save your file every 10 minutes or so - otherwise you may lose your work. To save your file chose the Save option from the File menu.


Operating Systems Unix Outline
(c) Malcolm Reeves, Department of Geological Sciences, University of Saskatchewan, 114 Science Place, Saskatoon, SK, Canada, S7N 5E2 Fax: (306) 966-8593