Unix

The operating system of the 1960s, still gaining in popularity in the 1990s. A horrible system, except that all the other commercial offerings are even worse.

  - Donald A. Norman, Apple Fellow, Apple Computer, Inc.

Unix Flavors

Two of the most famous products of Berkeley are LSD and Unix, I don't think that this is a coincidence.

  - Anonymous



1973 Ken Thompson and Dennis Richie rewrite Unix (version 4) in C for use in Bell Labs.
1976 AT&T makes Unix Version 6 available to universities (~125) and businesses (~400).
Bill Joy creates the Berkeley Software Distribution (BSD) package.
1978 Second Berkeley version (2BSD) released.
AT&T releases Version 7.
1979 Third Berkeley version (BSD 3.0) released.
Microsoft introduces XENIX for microcomputers.
1981 AT&T releases System III.
/usr/group, a user and vendor association begins standardization.
1983 AT&T announces System V Release 1
Sun Microsystems (founded by Bill Joy) develops SunOS.
4.1 BSD developed for DARPA.
4.2 BSD released with TCP/IP.
1985 System V Release 2 includes job control.
XENIX moved to a System V base.
POSIX standard developed by user groups.
Free Software Foundation (FSF), created by Richard Stallman, releases the emacs editor.
1986 FSF releases the gcc C compiler.
1987 System V Release 3 with TCP/IP, the Remote File System (RFS) and UNICODE.
4.3 BSD released.
Microsoft and AT&T merge XENIX and System V Release 3.2.
1988 Open Software Foundation (OSF) formed.
1990 System V Release 4 includes features from BSD, SunOS, and XENIX.
1991 OSF/1.0 released to compete with SVR4.
Commodore produces the first commercial release of SVR4.
Linus Torvalds creates the first Linux kernel.
1993 AT&T sells Unix System Labs to Novell.
Trademark and specification control given to X/Open group.
1995 SCO buys Unix (source code but not trademark) from Novell.
X/Open introduces UNIX 95 branding program.
1998 UNIX 98 brand specified by the Open Group (formerly X/Open and OSF).

Unix Timeline



Unix Design Goals and the "Unix Philosphy"



Terminals and Keyboards

Function                     Original KeyModern Key
Erase (Character)#BS (Ctrl-H) or DEL (ASCII 127)
Kill (erase line)@NAK (Ctrl-U)
EOF (end of file)EOT (Ctrl-D)EOT (Ctrl-D)
Intr (interrupt process)DEL ETX (Ctrl-C)
Quit (stop process) FS (Ctrl-\)
Swtch (send to background)   SUB (Ctrl-Z)

The Legacy of Manual Typewriters        

Original Problem: People type too quickly and jam typewriters.
Original Solution: QWERTY keyboards designed to prevent jams.
Second Problem: Typing slow and difficult for Unix developers.
Second Solution: Unix commands short (abbreviated) to reduce typing.
Lesson (Not) Learned: Design choices during the early stages of product development have a profound impact throughout its lifetime and even affect future products.

Shells

Command Format

FALCON} date
Mon Apr  5 14:37:00 EDT 1999

FALCON} date -u
Mon Apr  5 18:37:07 UTC 1999

FALCON} cal
   April 1999
 S  M Tu  W Th  F  S
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30

FALCON} cal 9 1752
   September 1752
 S  M Tu  W Th  F  S
       1  2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Resource & Process Management

Load averages: 0.50, 0.43, 0.36         149 processes: 148 sleeping, 1 running

Cpu States:    LOAD   USER   NICE    SYS   IDLE  BLOCK  SWAIT   INTR   SSYS
               0.50   1.6%   0.0%   1.0%  97.4%   0.0%   0.0%   0.0%   0.0%

Memory:   39488K (31796K) real, 69784K (52328K) virtual, 18688K free  Page# 1/14

  TTY   PID USERNAME PRI NI   SIZE    RES STATE    TIME %WCPU  %CPU COMMAND
pts/3 14057 cooleycd 178 20  3380K   352K run      0:00  1.79  1.03 top
rroot 27152 schenksj 168 24   792K   112K sleep   98:05  0.70  0.70 java
rroot 12438 httpd    154 20  5452K  2476K sleep    1:12  0.42  0.42 ns-httpd
ttyp2 11300 kirschsb 154 20   408K   308K sleep    0:10  0.36  0.36 slirp
rroot     3 root     128 20     0K     0K sleep   30:30  0.14  0.14 statdaemon
rroot   679 ora73    156 20  8824K   116K sleep    0:38  0.07  0.07 ora_dbwr_ACAD

File Management

FALCON} bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3     223317  177022   23963   88% /
/dev/vg00/lvol1      47829   14341   28705   33% /stand
/dev/vg11/lvol2    1012557  730625  180676   80% /work
/dev/vg01/lvol3    1009705  595773  312961   66% /var
/dev/vg01/lvol2     512499  353904  107345   77% /usr
/dev/vg11/lvol3     303645  254894   18386   93% /usr/local
/dev/vg03/u04      2035601  197002 1635038   11% /u04
/dev/vg04/u03      2035601 1115944  716096   61% /u03
/dev/vg05/u02      2035601  478190 1353850   26% /u02
/dev/vg06/u01      2035601 1170989  661051   64% /u01
/dev/vg00/lvol4     984928    7280  879155    1% /tmp
/dev/vg01/lvol1     512499  440960   20289   96% /opt
/dev/vg10/lvol3     512499  318449  142800   69% /ops
/dev/vg11/lvol1     303645  194901   78379   71% /jmu
/dev/vg12/lvol12   2035601  982167  951653   51% /home2
/dev/vg02/home1    2034506 1451308  379747   79% /home1
A Sample Directory Tree



File Management



File Management - Access & Security

  Permissions
  • Read
  • Write
  • Execute
      Users affected
  • User (owner)
  • Group members
  • Others
  drwxrwxr-x 3 root bin             1024 Jan 20 16:46 usr
	directory owned by root in the bin group
	read, write and execute by root user and members of bin group
	read and execute but no write by everyone else

  -rw-r----- 1 cooleycd users       2357 Dec 23 22:46 schedule.html
      a (data) file owned by cooleycd in the users group
      read and write access by user cooleycd,
      read access by members of group users, no access by others

  -rwxr--r-x 1 root bin            12288 Jun 10  1996 yes
      a (program) file owned by root in the bin group
      full access by the root user and read and execute by everyone else
      except those in the bin group who only get read access

Redirection and Pipelines

who > who.lst

less < who.lst

grep `whoami` /etc/passwd | cut -d: -f5

ps -ef | less

zcat /usr/man/man1.Z/ls.1 | nroff -man | more

who | wc -l

cut -d: -f6 /etc/passwd | grep home[12] |  
	cut -c2-6 | sort |  uniq -c | sort -n -r


Misc. Commands