| tee $HBB/board/session$$ 25 HDIRS - , - . : $ for DIR in $HDIRS > do > echo "disk usage for $DIR: `du -s $DIR`" > done 26 , . , $HDIRS HDIRS. , , $HDIRS . , - HDIRS. 28 P , PUBDIR, /usr/spool/uucppublic. uucp. 30 CDPATH. , , cd. (.) , , . .. ( ). . CDPATH $HDIRS, . - cd . , /etc "cd doc", $HOME/doc, CDPATH $HOME. , $HOME/doc/status "cd status" -- , $HOME/doc/status, $HOME/doc CDPATH. , CDPATH. , , , - . , "cd sys", $HOME/sys , $HOME/ src/sys. . 1-1 cd, - , UNIX. , , , . 1-1 cd ------------------------------------------------------------- CDPATH ------------------------------------------------------------- cd /usr/russ cd cd $HOME cd /usr/russ/src/asm cd asm cd $HSR/asm cd /usr/russ/doc/paper/conf cd paper/conf cd $HD/paper/conf cd /usr/russ/tmp cd tmp cd $HT ------------------------------------------------------------- 31 PATH. PATH , CDPATH. , , , PATH. , ": not found" ("<->: "). PATH , , . , - . PATH, , , : PATH=$PATH:/usr/lib/uucp paths, , $PATH, , - . 32 SHELL. . - , . 33 - CDPATH, PATH SHELL. 35-39 - - . 35 tty, (`...`). tty "/dev/tty00". - , .. "tty00". - , , . tset, - , XENIX - . 41 - TERM , , . , tset TERM . 42 TERMCAP, /etc/termcap. TERMCAP. - TERMCAP , - . TERMCAP - , vi - -, . - 43 , shell. 45 . XENIX , , System V. . 46 , - ctime(3). TZ, - - . 47 . 49 (umask). , - . umask 777. , 755. - 755, "ls -l" rwxr-xr-x. 755, rw-r--r--, 644. x, . x, - cd. 51 52 . 51 , 52 lastlog, . lastlog 5. 54-58 , . - ANSI. XENIX . , (foreground) (background) . - , 30, - 40. 60-66 - . . 60 date cut. , . - , - . - , .  UNIX , "" , - , ($HOME). , , $HOME ? ? - ? ? . - . , . , , . , , . UNIX, . , - . .. . .. , . . ls -l $HOME/.. . cd ../../.. , /usr/russ/src/c, /usr. ls . . ls .. . $HOME/../../bin/ls ls /usr/russ/../../bin, .. /bin/ls. ../fred/bin/ls ls , , , .. /usr/fred/bin/ls.   UNIX, UNIX. , - UNIX, , - , .. - . - , . , - UNIX, UNIX . , - . UNIX , - . , - , . , , . UNIX, . . , - , . , = + UNIX = + UNIX - : . , . - , . , . - System V . AT&T System V.   UNIX, - UNIX .1-3 . - . . /mnt. , /0, /1 .. /usr1, /usr2 ..   /bin, . . - /dev, - . , - . . /etc. getty gettydef, init inittab, (/etc/passwd). - /lib, . . /lost+found fsck ( ) . , - . - /mnt. . , -. - . /tmp. , vi, fsck, shell - , /tmp . - /usr, - . , , . - , . , . - , - . , - . /usr . - , /unix. /unix - a.out ( - ). ld , , - /unix. 512 . , , - , /boot. /boot /unix.   /usr. - , /usr . , , /usr, . adm, . su (- ), . bin , , (/bin). - . , /usr/lib/uucp/uucico /usr/lib/ ex3.7preserve. games. UNIX . - , - , worm, worms rain. include -. - , . sys, = , . -, UNIX. - lib, "": , vi, uucp. /usr/ lib , , - . lost+found , - . . fsck - . mail . mail, . - usr/mail . - , . man UNIX. - . , , - . news . , . - news(1) $HOME/ .news_time, , . preserve , vi. , vi ex "- ". , /tmp ex. /etc/rc /usr/lib/ex3.7preserve, /tmp, /usr/preserve. , , , . pub , ASCII - . spool - . , - . lp, uucp uucppublic. src UNIX, - . : , , , . /usr/src . sys , . -, , . - tmp. - , , /tmp. , , - sort.  UNIX:  UNIX - , . , , - ( root), (bin, cron, lp, sys) (/usr/*). , (/bin/su) - . - , UNIX . " - " ( - $HOME ). , ( ..), - , (, $HOME). ( /usr, - /usr/spool, /etc). , . , . UNIX . (/tmp) , (/etc/passwd). ( uucp). - , ( (rlogin), BSD). UNIX . ( , ). , - . , . , . (), ( - ) , , - ( - ). . , "". , "" "". - "" , . UNIX , "" "" - "". () , , . ( ). "", (- ). - , , ( , ulimit). () , , - (df ), - . . , , UNIX - . ( ) - . , - , ( acctcom ). UNIX ( ), . . . - , , . - , - .  * 2. *   2.1. 2.1.1. tree - 2.1.2. thead - 2.1.3. tgrep - 2.1.4. paths - , 2.2. 2.2.1. lc - 2.2.2. ll - 2.2.3. kind - 2.2.4. m - more 2.2.5. mmm - nroff 2.2.6. pall -  1 UNIX , . - , - . , - , - -. : , , , , . UNIX , , . - , - . , , UNIX , . UNIX, - , , , ls - . , . , - . - , UNIX, , , , , - , .. , - . , . , , : .   - . - , - , UNIX (, find) - , ( ). - , - -. - . UNIX , . - - . , - - . - , UNIX . , - , , , , , , - . ( - , - , .) - : . , , .   , , - . , tree, . - , - . - thead. Thead , . , .. , , . thead - thead . thead - UNIX, . - tgrep. - , , , grep. Tgrep , . Tgrep - , - . - "". , , - - . paths - , .   , - . - , , , . - ls. lc , - ll . - ls, - . ls , - . - , - . - kind. Kind - - , UNIX file. file , , . file , - . kind - file. Kind . - m, - more UNIX, . - : , more more , - m. - mmm. - nroff UNIX. nroff . nroff, , - . , mmm. - , , mmm ( , , ). - mmm - nroff. - pall. Pall , - , . pr UNIX . , . , . 2.1.  2.1.1. tree - ---------------------------------------------------- : TREE ---------------------------------------------------- tree -  - , .   tree [dir]   $ tree $HOME .   1 : 2 # @(#) tree v1.0 Visual display of a file tree Author: Russ Sage 2 4 if [ "$#" -gt 1 ] 5 then echo "tree: wrong arg count">&2 6 echo "usage: tree [dir]" >&2 7 exit 2 8 fi 9 if [ "$#" -eq 1 ] 10 then if [ ! -d $1 ] 11 then echo "$0: $1 not a directory">&2 12 echo "usage: tree [dir]" >&2 13 exit 2 14 fi 15 fi 17 find ${1:-.} -print | sort | sed -e "1p" -e "1d" \ 18 -e "s|[^/]*/| /|g" \ 19 -e "s|[^ */|/|" \ 20 -e "s|/\([^/]*\)$|\1|"  tree? , UNIX , . , UNIX, : , . , UNIX, : - ( ) . - , - . , , , . UNIX , . , , . . , , . tree UNIX, . - , , - . tree? tree - UNIX find. Find , - . tree - sed UNIX, find . tree , - , , /usr/spool/uucp, , , ../../bin. - , ., - . ( ) . , , - , . , (/). . /tmp : a b. a - aa, file1, b , , bb, file2. find : # find /tmp -print /tmp /tmp/a /tmp/a/aa /tmp/a/aa/file1 /tmp/b /tmp/b/bb /tmp/b/bb/file2 , a aa , file1 . - , tree, sed. # tree /tmp /tmp / a / / aa / / / file1 / b / / bb / / / file2 /tmp. , , - . - /tmp, - a b, , , aa bb. , , - ( - ) . , aa bb , file1 file2. "" find. tree . , . - , UNIX.  1. $ tree ( , - "$ tree .") . 2. $ tree / . - find . 3. $ tree $HOME/.. (, , /usr/*).  (:) - " - ". , , , , - Bourne shell. 2, , (#). -shell . , - . -shell - Bourne shell. #. , , - , - . , . 2 . @(#) - , "what" (""). what UNIX , "what". - , # what tree : tree: tree v1.0 Visual display of a file tree Author: Russ Sage 4-7 , - . $#, . , - (stderr) . , echo (stdout). stdout , . stderr. : " (&) (2)". stderr , .