working directory" ( -
). , /usr/joe,
:
pwd
:
/usr/joe
""
.
4.6.2.
lc.
, . -
, lc -
. lc :
lc
, work, -
:
lc work
:
accounts meetings notes
mail memos todo
, lc
. , :
lc
.
lc:
-a , ""
( ,
.profile .mailrc).
-r .
- 35 -
-t ,
- (
). -r
( -
).
-R ,
, ""
. "R" "recursive"
().
-F ('/'), -
('*').
ls , lc, -
,
, . ls -l
, :
total 501
drwxr-x--- 2 boris grp1 272 Apr 5 14:33 dir1
drwxr-x--- 2 enid grp1 272 Apr 5 14:33 dir2
drwxr-x--- 2 iris grp1 592 Apr 6 11:12 dir3
-rw-r----- 1 olaf grp2 282 Apr 7 15:11 file1
-rw-r----- 1 olaf grp2 72 Apr 7 13:50 file2
-rw-r----- 1 olaf grp2 1403 Apr 1 15:22 file3
-
( ):
-
-
-
-
-
-
-
,
, 4.8 "
".
-
ls(C) XENIX.
- 36 -
4.6.3.
mkdir. ,
phonenumbers, :
mkdir phonenumbers
.
4.6.4.
,
, rmdir. ,
phonenumbers ,
:
rmdir phonenumbers
phonenumbers , ,
; -
.
, -
rm,
. -
rm(C)
XENIX.
4.6.5.
mv.
, little.dir
big.dir :
mv little.dir big.dir
;
.
4.6.6.
mv . -
:
mv _ _
_ - , -
.
, /usr/joe/accounts
/usr/joe/overdue, :
- 37 -
mv /usr/joe/accounts /usr/joe/overdue
/usr/joe/accounts
/usr/joe/overdue. ?????.sh 3 " "
copy .
:
copy _ _
/usr/joe/memos
/usr/joe/notes, :
copy /usr/joe/memos /usr/joe/notes
usr/joe/memos
/usr/joe/notes. copy :
-l ( -
) .
-m
, .
-r , ..
.
4.7.
XENIX
. -
,
.
- .
, -
. ,
, .
4.7.1.
. pwd,
"print working directory" (
). , -
/usr, :
pwd
:
/usr
- 38 -
4.7.2.
: ", " XENIX.
, ,
" " - cd:
cd
.
,
cd.
, :
cd /usr
/usr.
"" ,
"" .
, :
cd ..
,
/usr/joe/work /usr/joe. :
cd ../..
/usr/joe/work /usr,
.
4.8.
XENIX -
, , ,
, .
,
, ls -l.
:
total 501
drwxr-x--- 2 boris grp1 272 Apr 5 14:33 dir1
drwxr-x--- 2 enid grp1 272 Apr 5 14:33 dir2
drwxr-x--- 2 iris grp1 592 Apr 6 11:12 dir3
-rw-r----- 1 olaf grp2 282 Apr 7 15:11 file1
-rw-r----- 1 olaf grp2 72 Apr 7 13:50 file2
-rw-r----- 1 olaf grp2 1403 Apr 1 15:22 file3
. dir1,
- 39 -
, -
:
drwxr-x---
. -
:
- .
d .
c
, , .
b ,
, .
n (.. ,
).
s .
p , -
.
, ,
.
:
-
-
-
, -
, ,
(.. ) .
" " -
.
:
r
w ( )
x
- 40 -
-
:
r ; "x"
.
w ;
, "r", "x"
.
x . -
cd, -
, -
,
"x". ,
"x", -
.
-
:
d---------
. ,
.
drwx------
.
lc, ,
,
cd.
.
drwxr-x---
.
lc
.
,
cd,
. -
,
.
drwx--x--x
, -
,
lc,
cd.
,
.
ls(C) XENIX.
- 41 -
4.8.1.
chmod. , -
,
, .
chmod :
chmod _
.
-
:
u , .
g , .
o - .
a .
:
r - -
, .
w - -
.
x -
.
, , file1 -
:
-rw-r-----
, , -
.
, file1
, :
chmod a+r file1
(a+r), "a" "all" ().
-
:
- 42 -
-rw-r--r--
file1 :
-rw-------
:
chmod g+wx file2
:
-rw--wx---
, :
chmod ug-wx file1
4.8.2.
.
, -
, .
- ,
.
, , dir1
:
drwxr-xr-x
-
, :
chmod o-xr dir1
:
drwxr-x---
4.9.
-
, , , . -
XENIX
.
.
- 43 -
4.9.1.
diff. -
, .
, , men
:
women :
:
diff men women
:
1c1
<
---
<
diff3.
diff3(C) XENIX.
4.9.2.
echo .
, :
echo "Now is the time
For all good men
To come to the
Aid of their party"
:
"Now is the time
For all good men
To come to the
Aid of their party"
- 44 -
echo
shell. C. 4
" " -
XENIX.
4.9.3.
sort. , sort
ASCII, . . .
, phonelist,
:
sort phonelist
. -
phonelist phonesort, :
sort phonelist > phonesort
, sort
. ,
who, :
who | sort >whosort
who,
whosort.
sort .
. sort(C)
XENIX.
4.9.4.
grep , -
. ,
, "tty38",
:
grep 'tty38' file
,
,
.
,
phonelist, ,
. ,
.
- 45 -
grep,
Joe, 822.
:
grep 'Joe' phonelist | grep '822-' >joes.number
grep , "Joe".
grep, , "822-"
Joe. -
, ,
Joe, 822,
joes.number.
grep,
"" fgrep egrep,
, (
" "), grep(C) -
XENIX.
4.9.5. ,
wc - .
'wc' word count ( ). -
, , -
, . wc
;
.
, ,
textfile, :
wc textfile
,
:
4432 18188 97808 textfile
,
, -
.
-
:
wc -c textfile
97808 textfile
wc -w textfile
18188 textfile
wc -l textfile
4432 textfile
- 46 -
textfile,
, .
4.9.6.
at
. ,
,
.
at
:
cat | at
- ,
. - , -
, "am" "pm", -
, , .
, ,
, - .
.
. , -
, . ,
.
, ,
,
,
use:
ps -a > /usr/myname/use
( ,
4 "vi: " -
XENIX).
, , :
cat use | at 10pm tues
RETURN. XENIX
. ,
, XENIX ps -a
use.
at .
, , -
, at -l.
, ,
. -
:
- 47 -
- .
- , (at batch).
- , .
,
-
. at -r
.
at -r :
at -r
:
at -r 504510300.a
504510300.a, ,
.
.
4.10.
XENIX
. ,
" ",
. -
, ,
. ,
,
, .
,
.
.
4.10.1.
, ,
; -
, .
.
, -
.
,
.
, ,
('&') . ,
,
- , :
- 48 -
wc file1 file2 file3 >count&
count. -
, -
.
,
. ,
INTERRUPT, .
kill,
.
4.10.2.
,
INTERRUPT.
, . ,
, -
, :
kill 0
- ,
:
ps
ps (PID)
. :
PID TTY TIME CMD
3459 03 0:15 -sh
4831 03 1:52 cc program.s
5185 03 0:00 ps
, :
kill 4831
4831 - ,
.
_______________________________________________________
, vi,
.
, , -
, -
kill. -
/tmp. -
.
- 49 -
__________________________________________________
4.11.
XENIX - ,
,
, : ,
, -
. -
.
4.11.1.
who ,
,
. , :
who
-
:
arnold tty02 Apr 7 10:20
daphne tty21 Apr 7 07:47
eliot tty23 Apr 7 14:21
elen tty35 Apr 7 08:36
gus tty26 Apr 7 09:55
adrian tty28 Apr 7 14:21
finger ,
,
. -
, finger(C)
XENIX.
4.11.2.
,
, .
ps "process status" ( )
,
. , ps -
:
PID TTY TIME CMD
10308 38 1:36 ed chap02.man
49 38 0:29 -sh
11267 38 0:00 ps
PID ,
- 50 -
-
. TTY -
, . TIME
.
kill.
, 4.10.2 "
".
, ,
, -a:
ps -a
, -
, -t,
. , , -
13, :
ps -t13
ps
, ps(C) XENIX.
4.11.3.
, -
, lpstat. lpstat -
, .
,
( ), -
.
lp,
. :
-_
- ,
( , -
), _ -
, .
, :
lpstat _
lpstat ,
, -
.
,
, , :
- 51 -
lpstat
lpstat -
.
,
, lpstat -p.
:
lpstat -p
lpstat -
,
.
lpstat
XENIX lpstat(C).
4.12.
XENIX, , -
-
.
, -
.
XENIX ,
,
,
.
4.12.1. : lp
, -
lp, lpr.
.
lp.
,
memo, :
lp memo
. -
, memo, report letter, -
:
lp memo report letter
, lp
.
, , :
- 52 -
pr4-532
("pr4") - ,
. ("232") -
.
, -
, -
. 4.12.3, "
", 4.12.4, "
:lpstat".
-
, -
.
lp
. -
pr.
textfile, :
pr textfile | lp
,
datafile, :
sort datafile | pr | lp
4.12.2. lp
lp ,
.
, -n, ,
. ,
report, :
lp report -n2
, -d,
, .. , -
. ,
.
report quick, :