Comparison of Unix and Dos: Assignment
Comparison of Unix and Dos: Assignment
UNIX
UNIX is a powerful computer operating system originally developed at AT&T Bell Laboratories. It is very popular among the scientific, engineering, and academic communities due to its multi-user and multi-tasking environment, flexibility and portability, electronic mail and networking capabilities, and the numerous programming, text processing and scientific utilities available. It has also gained widespread acceptance in government and business. Over the years, two major forms (with several vendors variants of each) of UNIX have evolved: AT&T UNIX System V and the University of California at Berkeleys Berkeley Software Distribution (BSD). This document will be based on the SunOS 4.1.3_U1, Suns combination of BSD UNIX (BSD versions 4.2 and 4.3) and System V
because it is the primary version of UNIX available at Rice. Also available are Solaris, a System Vbased version, and IRIX, used by Silicon Graphics machin.
Console display and keyboard (CON) Line printer (PRN) Auxiliary device (AUX) Date and time (CLOCK) Boot disk device (block device)
The primitive parts of the resident drivers are in the ROM BIOS while the rest are in the IO.SYS (or IBMBIO.COM) system file.
File and record management Memory management Character device input/output Spawning other programs Access to real-time clock.
The DOS kernel components are contained in the MSDOS.SYS (or IBMDOS.COM) system file. Programs communicate with the kernel via software interrupts.
Standard input CON Standard output CON Standard error CON Auxiliary AUX List device PRN
Structure of UNIX
The Directory Structure
All the files are grouped together in the directory structure. The file-system is arranged in a hierarchical structure, like an inverted tree. The top of the hierarchy is traditionally called root (written as a slash / )
In the diagram above, we see that the home directory of the undergraduate student "ee51vn" contains two sub-directories (docs and pics) and a file called report.doc. The full path to the file report.doc is "/home/its/ug1/ee51vn/report.doc"
UNIX filenames are arbitrary strings of up to 255 characters, MS-DOS filenames are limited to an 8 character file name and a 3 character file type, and have restrictions on allowable characters.
UNIX doesn't require the notion of a disk drive modifier for a file specification, i.e., you don't need A:, B:, C:, and so on like MS-DOS. Note that MS-DOS has the JOIN command which can simulate the UNIX file system.
UNIX uses forward slashes (/) to separate directories in a file specification, whereas MSDOS uses backslashes ( ).
UNIX is a full multiuser multitasking operating system, whereas MS-DOS is a singleuser OS without concepts like file-ownership and process priorities. UNIX has a richer command set than MS-DOS. UNIX and MS-DOS both have the concept of a PATH. UNIX and MS-DOS both have pipes and I/O redirection. UNIX displays characters on your terminal as you type them, regardless of whether the operating system is ready to accept a command. MS-DOS will buffer, but not display, terminal input when it is busy executing the previous command.
Keyboard Operations
Action UNIX stty DOS
Alternative to Enter
Ctrl-J or Ctrl-M
Esc-K from vi
F3
Clear Screen
Ctrl-L
Ctrl-H or #
Backspace key
Kill all the way back to the prompt (without executing it)
@ or Ctrl-U or Ctrl-X
Ctrl-C
Stop
Ctrl-Z or q
Ctrl-D
Ctrl-Z
Scroll forward
spacebar
Scroll back
up arrow
Stop scrolling
Ctrl-S
Resume scrolling
Ctrl-Q
Ctrl-Q
Alt+F8
Ctrl+Alt+F1
Command Comparison:
DOS Command DIR UNIX or Bash Command ls -l (or use ls -lF)(-a all files) (df -k Space remaining on filesystem) ls -tr ls -ls ls -R ls -a ls -R cd mkdir ln rmdir pwd rm -iv rm -R cp -piv cp -R mv -iv cat more man clear ctrl-l exit exit 0 grep diff Action List directory contents List directory contents by reverse time of modification/creation. List files and size List directory/sub-directory contents recursively. List hidden files. List directory recursivly Change directory Make a new directory Create a file or directory link Remove a directory Display directory location Remove a file Remove all directories and files below given directory Copy a file Copy all file of directory recursivly Rename/move a file Dump contents of a file to users screen Pipe output a single page at a time Online manuals Clear screen Exit a shell Look for a word in files given in command line Compare two files and show differences. Also see comm, cmp,
TREE CD MKDIR MD ASSIGN RMDIR RD CHDIR DEL ERASE RMDIR /S (NT) DELTREE (Win 95...) COPY XCOPY RENAME or MOVE TYPE MORE HELP or COMMAND /? CLS EXIT EXIT0 FIND FINDSTR COMP
mgdiff and tkdiff. FC SET SET variable=value echo %variable% diff set and env set export variable=value echo $variable ECHO text SET variable echo text setenv (for C shell) or export VAR=val (for Korn shell. Also VAR=val) Echo text to screen Set environment variables Display search path for executables. Set PATH environment variable. Set user command prompt. Show date. (also set date - DOS only) List command history Set command alias Trap ctrl-break / Trap signals. Sort data alphabetically/numerically Line mode editor Edit a file. The Linux editor which looks most like DOS edit is probably Pico. (Not a recomendation!) Save files to floppy. See Using DOS floppies Read files from floppy. See Using DOS floppies Change file permissions. DOS: +:set to -:remove r:Read only a:Archive s:System /s:recursively Change file to a hidden file - rename file with prefix "." Print a file Compare two files and show differences. Also see comm, cmp, mgdiff and tkdiff. List all environment variables Set environment variables Show environment variables
PATH echo $PATH PATH %PATH%;C:\DIR PATH=$PATH:/dir PROMPT $p$g DATE or TIME DOSKEY /h DOSKEY NAME=command BREAK ON SORT EDLIN EDIT filename.txt export PS1='\h(\u)\W> ' date history alias NAME=command trap sort ed pico, gnp, vi, xedit, xemacs,dtpad tar -cvf /dev/fd0 files mdir, mcopy doswrite -a file (AIX only) tar -xvf /dev/fd0 files mdir, mcopy dosread -a file (AIX only) chmod mv file .file lpr
RESTORE A:\ files ATTRIB [+r|-r] [+a|-a] [+s|-s] [path\file] /s ATTRIB +h or h PRINT