![]() July 1988
UNIX and MS-DOSUNIX is the operating system developed by AT&T and now used on multi-user computers from many manufacturers. MS-DOS is the operating system developed by Microsoft for IBM's first personal computers. MS-DOS is a single-user operating system for PC-compatibles. Most PC users refer to it as "DOS", which means "Disk Operating System." UNIX and MS-DOS have many similarities. We will explore some of these similarities, in order to show that UNIX is not very difficult to learn for someone familiar with MS-DOS. 1. File systems The UNIX and MS-DOS file systems both use directories, and their directories contain files and other directories. If a hard disk is like a filing cabinet, then a directory is like a file folder. A directory may contain many files, analogous to the documents in a file folder. A directory may also contain other directories. This is like putting one file folder inside another file folder, which is unusual in a filing cabinet but very common in a computer. A full pathname is a list of all the directories leading to a particular file. For instance, "/usr/bin/uni" means that the root directory (known as "/") contains a directory called "usr", "usr" contains a directory called "bin", and "bin" contains a file called "uni". This is a UNIX file name; the MS-DOS equivalent might be "\USR\BIN\UNI.EXE". This hierarchical file system is the most difficult idea for new users of either MS-DOS or UNIX to understand. The difficulty is the same for both operating systems, however, because MS-DOS borrowed the concept from UNIX. Because UNIX is a multi-user operating system, each user has a personal directory, called a home directory. If your UNIX login name is "rtg", your home directory is "/usr/rtg". Other directories you create normally go in your home directory, such as "/usr/rtg/letters" and "/usr/rtg/agreements". UNIX prevents you from changing or deleting someone else's files. MS-DOS has nothing equivalent to the home directory, because it is a single-user system. MS-DOS file names consist of up to eight characters, followed by a period and up to three more characters. UNIX file names are more flexible. They may be up to 14 characters (and more in many UNIX versions). Periods, often used in UNIX file names, may appear anywhere in the name. 2. Command lines Both operating systems expect the user to type a command line, then press the RETURN key. The computer acts on the information typed in and awaits another command line. Under MS-DOS the program which reads command lines is the command processor, and under UNIX it is the shell. One difference is that MS-DOS commands and file names always get converted to upper-case, so they can be typed without regard to capitalization. UNIX keeps the user's capitalization. By convention, all UNIX commands and most file names are entirely lower-case. 3. Commonly-used commands The table below lists the most common UNIX commands and their MS-DOS equivalents. At any given moment, under MS-DOS or UNIX, you have a current directory (also called the working directory). Both operating systems have commands which show the current directory, change the current directory, list the files in a directory, make a new directory, or remove an empty directory. Erasing a file is similar for MS-DOS and UNIX. The UNIX rm command is short for "remove", and the MS-DOS DEL command is short for "delete". Both commands can accept "wildcards", an asterisk which specifies several files at one time. The dangerous UNIX command rm * deletes all the files in the current directory. The comparable MS-DOS command, DEL *.*, asks if you are sure. The UNIX mv ("move") command is somewhat different from the MS-DOS REN ("rename") command. The mv command can change the file name like REN, but it can also put a file in a different directory. You can say mv /usr/rtg/uni /usr/bin and the file "uni" is removed from directory "/usr/rtg" and placed in directory "/usr/bin". The file is never actually copied from one place to another (which can be slow); only directory entries are changed (which is fast). With MS-DOS you would have to COPY the file and then delete (DEL) the original. Standard MS-DOS does not have a "move" command, although there are public-domain programs which add this feature. COMMON UNIX COMMANDS AND THEIR MS-DOS EQUIVALENTS
RTG Bills and RTG Timer are trademarks of RTG Data Systems. Other company and product names may be trademarks of the companies with which they are associated. Copyright © 1988 RTG Data Systems |