Wel
com
e to
AIX
5L
Ver
sio
n 5
.1B
asic
sC
ou
rse
Co
de
AU
13
Co
urs
e D
escr
ipti
on
Pu
rpo
seT
his
co
urs
e is
de
sig
ne
d t
o
Au
die
nce
Th
is c
ou
rse
is d
esi
gn
ed
fo
r
Pre
req
uis
ites
Be
fore
att
en
din
g th
is c
ou
rse
, th
e s
tud
en
t sh
ou
ld h
ave
Ob
ject
ives
Aft
er
com
ple
ting
th
is c
ou
rse
, st
ud
en
ts s
ho
uld
be
ab
le t
o:
Lo
gin
to
an
AIX
sys
tem
an
d s
et
a u
ser
pa
ssw
ord
Use
AIX
on
line
do
cum
enta
tio
n
Ma
na
ge
AIX
file
s a
nd
dir
ecto
ries
De
scrib
e t
he
pu
rpo
se o
f th
e s
hel
l
Use
th
e v
i ed
itor
Exe
cute
co
mm
on
AIX
co
mm
and
s a
nd
ma
na
ge
pro
cess
es
Cu
sto
miz
e th
e w
ork
ing
en
viro
nm
ent
Write
sim
ple
sh
ell
scri
pts
Use
co
mm
on
AIX
uti
litie
s
Use
th
e A
IXw
ind
ow
s e
nvi
ron
me
nt
Use
th
e C
om
mo
n D
eskt
op
En
viro
nm
ent
(CD
E)
Ag
end
a
Day
1
W
elc
om
e
Un
it 1
:In
tro
du
ctio
n to
AIX
Un
it 2
:U
sin
g th
e S
yste
m
Un
it 3
:A
IX D
ocu
me
nta
tion
Un
it 4
:F
iles
an
d D
ire
cto
rie
s
Un
it 5
:U
sin
g F
iles
Un
it 6
:F
ile P
erm
issi
on
s
Un
it 7
:T
he
vi E
dito
r
Un
it 8
:S
he
ll B
asi
cs
Un
it 9
:U
sin
g S
he
ll V
ari
ab
les
Day
2
Ag
end
a (C
on
t)
Un
it 1
7:
Cu
sto
miz
ing
AIX
win
do
ws
(2)
Un
it 1
8:
Usi
ng
th
e C
om
mo
n D
esk
top
En
viro
nm
en
t (C
DE
)
Un
it 1
9:
CD
E U
ser
Cu
sto
miz
atio
n
Day
5
Un
it 1
4:
AIX
Util
itie
s, P
art
II
(2)
Un
it 1
5:
Ad
diti
on
al S
he
ll F
ea
ture
s
Un
it 1
6:
AIX
win
do
ws
Co
nce
pts
Un
it 1
7:
Cu
sto
miz
ing
AIX
win
do
ws
(1)
Day
4
Un
it 9
:P
roce
sse
s
Un
it 1
0:
Co
ntr
olli
ng
Pro
cess
es
Un
it 1
2:
Cu
sto
miz
ing
th
e U
ser
En
viro
nm
en
t
Un
it 1
3:
AIX
Util
itie
s
Un
it 1
4:
AIX
Util
itie
s, P
art
II
(1)
Day
3
Cla
ss L
og
isti
cs
Sch
ed
ule
Bre
aks
an
d lu
nch
Sta
rt a
nd
sto
p tim
es
Lo
gis
tics
Bu
ildin
g a
cce
ssM
ess
ag
es
Fa
cilit
ies
Sm
oki
ng
po
licy
Pa
rkin
gE
me
rge
ncy
exi
ts
Ma
nu
al f
on
t co
nve
ntio
ns
Intr
od
uct
ion
s
Na
me
Co
mp
an
y
Job
du
ties
AIX
or
oth
er
UN
IX e
xperience
Co
mp
ute
r sy
ste
ms
at
wo
rk
Sys
tem
usa
ge
/ap
plic
atio
n
Exp
ect
atio
ns
Un
it 2
Usi
ng
th
e S
yste
m
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Lo
g in
an
d o
ut
of
the
sys
tem
Sta
te t
he
str
uct
ure
of
AIX
co
mm
and
s
Exe
cute
bas
ic A
IX c
om
man
ds
Use
AIX
co
mm
an
ds
to c
om
mu
nic
ate
with
oth
er u
sers
Lo
gg
ing
In a
nd
Ou
t
To L
og in
:
login: team01
team01's Password: (the password does not appear)
$ _
To L
og o
ut:
$ <ctrl-d>
(or)
$ exit
(or)
$ logout
login: _
Pas
swo
rds
Cre
atin
g o
r C
hangin
g:
$ passwd
Changing password for "team01"
team01's Old password :
team01's New password:
Enter the new password again:
$ _
Co
mm
and
Fo
rmat
AIX
co
mm
and
s h
ave
the
follo
win
g f
orm
at:
$ command
option(s) argument(s)
$ mail-f
newmail
Co
mm
and
Fo
rmat
Exa
mp
les
RIG
HT
:
WR
ON
G:
1. S
epar
atio
n:
$ mail -f newmail
$ mail - f newmail
$ who -u
$ who-u
2. O
rder
:
$ mail -f newmail
$ mail newmail -f
$ mail team01
$ team01 mail
$ who -u
$ -u who
3. M
ult
iple
Op
tio
ns:
$ who
-m-u
$ who -m-u
$ who
-mu
$ who -m u
4. M
ult
iple
Arg
um
ents
:
$ mail team01 team02
$ mail team01team02
TH
ER
E A
RE
EX
CE
PT
ION
S!!
dat
e an
d c
al C
om
man
ds
Ch
ecki
ng
th
e d
ate:
$ date
Fri Jan 14 10:15:00
GMT
2000
Lo
oki
ng
at
a m
on
th:
$ cal 1 2000
January 2000
Sun Mon Tue Wed Thu Fri Sat
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 31
Lo
oki
ng
at
a ye
ar:
$ cal 2001
Th
e cl
ear,
ech
o, a
nd
ban
ner
Co
mm
and
s
clea
r: C
lears
the term
inal s
creen
$ clear
ech
o:
Write
s w
hat fo
llow
s to
the s
creen
$ echo Lunch is at 12:00
Lunch is at 12:00
ban
ner
: W
rite
s ch
ara
cter
strings
in la
rge le
tters
to the s
creen
$ banner Hello
Act
ivit
y: Q
ues
tio
ns
and
An
swer
s
1.W
ha
t's w
ron
g w
ith t
he
fo
llow
ing
co
mm
an
ds?
$ du -s k
$ df-k
$ du -a-k
2.W
hic
h c
om
ma
nd
...
...
changes
your
pass
word
?
...
cle
ars
th
e s
cre
en
?
... prints
out th
e c
urr
ent sy
stem
date
?
...
exi
ts t
he c
urr
ent
shell
?
Th
e w
ho
an
d f
ing
er C
om
man
ds
Fin
din
g w
ho
is o
n t
he
syst
em:
$ who
root
lft0 Sept 4 14:29
team01
pts/0
Sept 4 17:21
Fin
din
g w
ho
yo
u a
re:
$ who am i
team01
pts/0
Sept 4 17:21 (or)
$ whoami
team01
fin
ger
: D
ispla
ys in
form
atio
n a
bout th
e u
sers
curr
ently
logged o
n
$ finger team02
Login name: team02
Directory: /home/team02
Shell: /usr/bin/ksh
On since Mar 04 16:17:10 on tty3
No Plan.
Sen
din
g M
ail
$ mail team01
Subject:
Meeting
There will be a brief announcement meeting today
in room 602 at noon.
<ctrl -d>
Cc: <Enter>
$ mail team20@sys2
Subject: Don't Forget!
Don't forget about the meeting today!
<ctrl -d>
Cc: <Enter>
Rec
eivi
ng
Mai
l[Y
OU
HA
VE
NE
W M
AIL
]
$ m
ail
[5.2
UC
B] [A
IX4.1
] T
ype ?
for
help
"/va
r/sp
ool/m
ail/
team
01":
2 m
ess
ages
1 n
ew
U
1 team
05
Tues
Jan 4
10:5
0
10/2
67
"Hello
!"
>N
2
team
02
We
d
Jan 5
11
:25
16/3
11
"Meetin
g"
? t
2
Fro
m team
02 W
ed Ja
n 5
11
:25 2000
Da
te:
Wed
5 J
an
2
00
0 11
:25
Fro
m:
team
02
To:
team
01
Su
bje
ct:
Mee
ting
Cc:
There
will
be a
brief announce
ment m
eetin
g today
in r
oom
602 a
t noon.
? d
(Dele
te m
ess
age)
? q
(Quit
com
mand)
wri
te a
nd
wal
l
wri
te:
Send m
essa
ges
to o
ther
use
rs o
n a
sys
tem
$ write team01 (or)
$ write sarah@moon
write
pro
vides
con
vers
atio
n-l
ike
com
munic
atio
n w
ith a
noth
er
log
ge
d-in
use
r. E
ach
use
r a
ltern
ativ
ely
se
nd
s a
nd
re
ceiv
es
me
ssa
ge
s.
The
wal
l co
mm
and w
rite
s to
all
term
inals
. T
his
is u
sefu
l to n
otif
y all
use
rs o
f a
sys
tem
eve
nt:
Fo
r e
xam
ple
:
$ wall The system will be inactive from 10 pm today.
talk
Wit
h A
no
ther
Use
r
$ talk fred
(
use
r fr
ed
will
re
ceiv
e t
he
fo
llow
ing
me
ssa
ge
)
Message from TalkDaemon@sys1 at 16:03 ...
talk: connection requested by john@sys1
talk: respond with: talk john
(
to a
cce
pt
the
invi
tatio
n f
red
en
ters
:)
$ talk john
mes
g
The m
esg
com
mand c
ontr
ols
wheth
er
oth
er
use
rs o
n t
he s
yste
m
can s
end m
ess
ages
to y
ou:
$ mesg n
Refu
ses
mess
ages
$ mesg y
P
erm
its m
ess
ages
Key
bo
ard
Tip
s
<B
acks
pac
e>
<C
trl-
c>
<C
trl-
d>
<C
trl-
s>
<C
trl-
q>
<C
trl-
u>
Co
rre
cts
mis
take
s
Term
inate
s th
e c
urr
ent
com
ma
nd
an
d r
etu
rns
to th
esh
ell
End o
f tr
ansm
issi
on o
r end
of
file
Tem
po
rarily
sto
ps
ou
tpu
t to
the s
creen
Resu
mes
outp
ut (s
topped
by
Ctr
l-s)
Era
ses
the e
ntir
e li
ne
Nex
t S
tep
...
Exe
rcis
e 1
What is
the c
orr
ect
com
mand s
ynta
x in
AIX
?$ mail newmail -f
$ mail f newmail
$ -f mail
$ mail -f newmail
What co
mm
and w
ould
you u
se to s
end m
ail
item
s?
_____________________________________________________
What are
oth
er
com
mands
that ca
n b
e u
sed to c
om
munic
ate
with
oth
er
use
rs?
_____________________________________________________
What
outp
ut
would
you e
xpect
fro
m t
he f
ollo
win
g c
om
mand: c
al 8
?
_____________________________________________________
Whic
h c
om
mand w
ould
you u
se to fin
d o
ut w
hen a
part
icula
r use
r lo
gged in
?$ who am i
$ who
$ finger everyone
$ finger username
Un
it 2
: C
hec
kpo
int
Su
mm
ary
AIX
co
mm
an
ds
can
use
mu
ltip
le o
ptio
ns
an
d a
rgu
me
nts
a
nd
mu
st f
ollo
w p
rop
er
syn
tax
rule
s
Th
ere
are
ma
ny
sim
ple
, ye
t p
ow
erf
ul c
om
ma
nd
s su
ch
as: da
teca
lw
ho
, w
ho
am
ifin
ge
re
cho
cle
ar
ba
nn
er
wc
Co
mm
un
ica
te w
ith o
the
r U
NIX
use
rs u
sin
g c
om
ma
nd
s su
ch a
s m
ail,
write
, ta
lk,
an
d w
all
Un
it 2
Usi
ng
th
e S
yste
m
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Lo
g in
an
d o
ut
of
the
sys
tem
Sta
te t
he
str
uct
ure
of
AIX
co
mm
and
s
Exe
cute
bas
ic A
IX c
om
man
ds
Use
AIX
co
mm
an
ds
to c
om
mu
nic
ate
with
oth
er u
sers
Lo
gg
ing
In a
nd
Ou
t
To L
og in
:
login: team01
team01's Password: (the password does not appear)
$ _
To L
og o
ut:
$ <ctrl-d>
(or)
$ exit
(or)
$ logout
login: _
Pas
swo
rds
Cre
atin
g o
r C
hangin
g:
$ passwd
Changing password for "team01"
team01's Old password :
team01's New password:
Enter the new password again:
$ _
Co
mm
and
Fo
rmat
AIX
co
mm
and
s h
ave
the
follo
win
g f
orm
at:
$ command
option(s) argument(s)
$ mail-f
newmail
Co
mm
and
Fo
rmat
Exa
mp
les
RIG
HT
:
WR
ON
G:
1. S
epar
atio
n:
$ mail -f newmail
$ mail - f newmail
$ who -u
$ who-u
2. O
rder
:
$ mail -f newmail
$ mail newmail -f
$ mail team01
$ team01 mail
$ who -u
$ -u who
3. M
ult
iple
Op
tio
ns:
$ who
-m-u
$ who -m-u
$ who
-mu
$ who -m u
4. M
ult
iple
Arg
um
ents
:
$ mail team01 team02
$ mail team01team02
TH
ER
E A
RE
EX
CE
PT
ION
S!!
dat
e an
d c
al C
om
man
ds
Ch
ecki
ng
th
e d
ate:
$ date
Fri Jan 14 10:15:00
GMT
2000
Lo
oki
ng
at
a m
on
th:
$ cal 1 2000
January 2000
Sun Mon Tue Wed Thu Fri Sat
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 31
Lo
oki
ng
at
a ye
ar:
$ cal 2001
Th
e cl
ear,
ech
o, a
nd
ban
ner
Co
mm
and
s
clea
r: C
lears
the term
inal s
creen
$ clear
ech
o:
Write
s w
hat fo
llow
s to
the s
creen
$ echo Lunch is at 12:00
Lunch is at 12:00
ban
ner
: W
rite
s ch
ara
cter
strings
in la
rge le
tters
to the s
creen
$ banner Hello
Act
ivit
y: Q
ues
tio
ns
and
An
swer
s
1.W
ha
t's w
ron
g w
ith t
he
fo
llow
ing
co
mm
an
ds?
$ du -s k
$ df-k
$ du -a-k
2.W
hic
h c
om
ma
nd
...
...
changes
your
pass
word
?
...
cle
ars
th
e s
cre
en
?
... prints
out th
e c
urr
ent sy
stem
date
?
...
exi
ts t
he c
urr
ent
shell
?
Th
e w
ho
an
d f
ing
er C
om
man
ds
Fin
din
g w
ho
is o
n t
he
syst
em:
$ who
root
lft0 Sept 4 14:29
team01
pts/0
Sept 4 17:21
Fin
din
g w
ho
yo
u a
re:
$ who am i
team01
pts/0
Sept 4 17:21 (or)
$ whoami
team01
fin
ger
: D
ispla
ys in
form
atio
n a
bout th
e u
sers
curr
ently
logged o
n
$ finger team02
Login name: team02
Directory: /home/team02
Shell: /usr/bin/ksh
On since Mar 04 16:17:10 on tty3
No Plan.
Sen
din
g M
ail
$ mail team01
Subject:
Meeting
There will be a brief announcement meeting today
in room 602 at noon.
<ctrl -d>
Cc: <Enter>
$ mail team20@sys2
Subject: Don't Forget!
Don't forget about the meeting today!
<ctrl -d>
Cc: <Enter>
Rec
eivi
ng
Mai
l[Y
OU
HA
VE
NE
W M
AIL
]
$ m
ail
[5.2
UC
B] [A
IX4.1
] T
ype ?
for
help
"/va
r/sp
ool/m
ail/
team
01":
2 m
ess
ages
1 n
ew
U
1 team
05
Tues
Jan 4
10:5
0
10/2
67
"Hello
!"
>N
2
team
02
We
d
Jan 5
11
:25
16/3
11
"Meetin
g"
? t
2
Fro
m team
02 W
ed Ja
n 5
11
:25 2000
Da
te:
Wed
5 J
an
2
00
0 11
:25
Fro
m:
team
02
To:
team
01
Su
bje
ct:
Mee
ting
Cc:
There
will
be a
brief announce
ment m
eetin
g today
in r
oom
602 a
t noon.
? d
(Dele
te m
ess
age)
? q
(Quit
com
mand)
wri
te a
nd
wal
l
wri
te:
Send m
essa
ges
to o
ther
use
rs o
n a
sys
tem
$ write team01 (or)
$ write sarah@moon
write
pro
vides
con
vers
atio
n-l
ike
com
munic
atio
n w
ith a
noth
er
log
ge
d-in
use
r. E
ach
use
r a
ltern
ativ
ely
se
nd
s a
nd
re
ceiv
es
me
ssa
ge
s.
The
wal
l co
mm
and w
rite
s to
all
term
inals
. T
his
is u
sefu
l to n
otif
y all
use
rs o
f a
sys
tem
eve
nt:
Fo
r e
xam
ple
:
$ wall The system will be inactive from 10 pm today.
talk
Wit
h A
no
ther
Use
r
$ talk fred
(
use
r fr
ed
will
re
ceiv
e t
he
fo
llow
ing
me
ssa
ge
)
Message from TalkDaemon@sys1 at 16:03 ...
talk: connection requested by john@sys1
talk: respond with: talk john
(
to a
cce
pt
the
invi
tatio
n f
red
en
ters
:)
$ talk john
mes
g
The m
esg
com
mand c
ontr
ols
wheth
er
oth
er
use
rs o
n t
he s
yste
m
can s
end m
ess
ages
to y
ou:
$ mesg n
Refu
ses
mess
ages
$ mesg y
P
erm
its m
ess
ages
Key
bo
ard
Tip
s
<B
acks
pac
e>
<C
trl-
c>
<C
trl-
d>
<C
trl-
s>
<C
trl-
q>
<C
trl-
u>
Co
rre
cts
mis
take
s
Term
inate
s th
e c
urr
ent
com
ma
nd
an
d r
etu
rns
to th
esh
ell
End o
f tr
ansm
issi
on o
r end
of
file
Tem
po
rarily
sto
ps
ou
tpu
t to
the s
creen
Resu
mes
outp
ut (s
topped
by
Ctr
l-s)
Era
ses
the e
ntir
e li
ne
Nex
t S
tep
...
Exe
rcis
e 1
What is
the c
orr
ect
com
mand s
ynta
x in
AIX
?$ mail newmail -f
$ mail f newmail
$ -f mail
$ mail -f newmail
What co
mm
and w
ould
you u
se to s
end m
ail
item
s?
_____________________________________________________
What are
oth
er
com
mands
that ca
n b
e u
sed to c
om
munic
ate
with
oth
er
use
rs?
_____________________________________________________
What
outp
ut
would
you e
xpect
fro
m t
he f
ollo
win
g c
om
mand: c
al 8
?
_____________________________________________________
Whic
h c
om
mand w
ould
you u
se to fin
d o
ut w
hen a
part
icula
r use
r lo
gged in
?$ who am i
$ who
$ finger everyone
$ finger username
Un
it 2
: C
hec
kpo
int
Su
mm
ary
AIX
co
mm
an
ds
can
use
mu
ltip
le o
ptio
ns
an
d a
rgu
me
nts
a
nd
mu
st f
ollo
w p
rop
er
syn
tax
rule
s
Th
ere
are
ma
ny
sim
ple
, ye
t p
ow
erf
ul c
om
ma
nd
s su
ch
as: da
teca
lw
ho
, w
ho
am
ifin
ge
re
cho
cle
ar
ba
nn
er
wc
Co
mm
un
ica
te w
ith o
the
r U
NIX
use
rs u
sin
g c
om
ma
nd
s su
ch a
s m
ail,
write
, ta
lk,
an
d w
all
Un
it 3
AIX
Do
cum
enta
tio
n
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Use
the m
an c
om
ma
nd
to
vie
w in
form
atio
n a
bo
ut A
IX
com
ma
nd
s
De
scrib
e th
e u
se o
f A
IX V
5.1
web
-bas
ed o
nlin
e d
ocu
men
tati
on
Ob
ject
ives
man
Co
mm
and
Th
e m
an c
om
ma
nd
pro
vid
es
refe
ren
ce in
form
atio
n o
n
com
man
ds,
su
bro
uti
nes
and f
iles.
Ma
nu
al i
nfo
rma
tion
co
nsi
sts
of:
PU
RP
OS
E(o
ne
-lin
e d
esc
rip
tion
)S
YN
TAX
(syn
tax)
DE
SC
RIP
TIO
NF
LA
GS
FIL
ES
(ass
oci
ate
d f
iles)
RE
LA
TE
D IN
FO
RM
AT
ION
BU
GS
(od
d b
eh
avi
or)
man
Exa
mp
le$ man who
Purpose
Identifies the users currently logged in.
Syntax
who [ -a | -b -d -h -i -I -m -p -q -u -H -T ] [ File ]
who am { i | I}
Description
The who command displays information about all users currently on the
local system. The following information is displayed: login name,
workstation name, date and time of login.
Flags
-m
Displays information about the current terminal. The
who -m command is equivalent to the who am i and
who am I commands.
-u or -i
Displays the user name, workstation name, login time,
line activity, and process ID of each current user.
Examples
1. To display information about who is using the local system node,
enter:
who
Implementation Specifics
This command is part of Asynchronous Terminal Emulation (ATE)
Files
/etc/utmp
Contains user and accounting information.
man
-k:
Wo
rkin
g w
ith
a K
eyw
ord
Th
e -
k optio
n o
f th
e m
an c
om
mand a
llow
s yo
u to p
rint out one-lin
e
desc
riptio
ns
of all
entr
ies
whic
h m
atc
h the g
iven k
eyw
ord
.
Exa
mple
:
$ man -k print
cancel(1)
Cancels requests to a line printer
disable(1)
Disables a printer queue
enable(1)
Enables a printer queue
lpr(1)
Enqueues print jobs
lpstat(1)
Displays line printer status information
qcan(1)
Cancels a print job
qchk(1)
Displays the status of a print queue
Do
cum
en
tatio
n S
erv
er
AIX
5.1
sof
tcop
y d
ocu
me
nta
tion
Do
cum
en
tatio
n S
ea
rch
Se
rvic
eW
eb s
erve
r so
ftw
are
Web
bro
wse
r so
ftw
are
Do
cum
en
tatio
n C
lien
tW
eb b
row
ser
softw
are
Do
cum
en
tatio
n C
lien
tW
eb b
row
ser
softw
are
Vie
w A
IX d
ocu
menta
tion fro
m a
nyw
here
with
a
bro
wse
r
AIX
V5.
1 D
ocu
men
tati
on
AIX
Ver
sio
n 5
.1 D
ocu
men
tati
on
Lib
rary
Nav
igat
ing
th
e D
ocu
men
t T
ree
Exp
and
bu
tto
n
Co
llap
se b
utt
on
Sea
rch
ing
AIX
Ve
rsio
n 5
.1 D
ocu
men
tati
on
Sim
ple
Searc
h
Adva
nce
d S
earc
h
Sea
rch
Res
ult
s
Nex
t S
tep
...
Exe
rcis
e 2
Un
it 3
: C
hec
kpo
int
1.W
hic
h c
om
ma
nd
dis
pla
ys m
an
ua
l en
trie
s o
nlin
e?
_
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
2.C
om
ple
te t
he
fo
llow
ing
se
nte
nce
s:T
he
AIX
V5
.1 o
nlin
e d
ocu
me
nta
tion
is lo
ad
ed
on
a
__
__
__
__
_ _
__
__
__
. A
ny
oth
er
com
pu
ter
in th
e
ne
two
rk w
ith a
pp
rop
ria
te w
eb
-bro
wse
r so
ftw
are
ca
n
the
n b
eco
me
a _
__
__
__
__
__
__
__
.
3.H
ow
ca
n y
ou
sta
rt t
he
Do
cum
en
tatio
n L
ibra
ry f
rom
th
e
com
ma
nd
lin
e ?
_
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
Th
e m
an c
om
ma
nd
ca
n b
e u
sed
fro
m th
e c
om
ma
nd
lin
e
to v
iew
de
scrip
tion
s o
f A
IX c
om
ma
nd
s
Use
a w
eb b
row
ser
to a
cce
ss o
nlin
e d
ocu
men
tati
on
w
ith A
IX V
5.1
Su
mm
ary
Un
it 4
File
s an
d
Dir
ecto
ries
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
De
scrib
e th
e d
iffe
ren
t fi
le t
ypes
Desc
ribe the A
IX f
ile s
yste
m s
tru
ctu
re
Use
fu
ll a
nd
rel
ativ
e p
ath
nam
es in
a file
sp
eci
fica
tion
Cre
ate
, d
ele
te, a
nd
list
dir
ecto
ries
Use
th
e t
ou
ch c
om
mand t
o c
reate
an e
mp
ty f
ile
A F
ile
A f
ile is
:
A c
olle
ctio
n o
f d
ata
A s
trea
m o
f ch
arac
ters
or
a "
byt
e s
tre
am
"
No
str
uct
ure
is im
po
sed
on
a file
by
the
op
era
ting
sy
ste
m
File
Typ
es
Ord
inar
y:
Tex
t or
cod
e d
ata
Dir
ecto
ry:
A t
able
of
con
ten
ts, t
hat
store
s a li
st o
f fi
les
with
in t
ha
tdirect
ory
Sp
ecia
l File
s:
Repre
sent
hard
ware
or
logic
al d
evic
es
Exa
mp
le: C
D-R
OM
-Dev
ice
is r
epre
sente
d b
y /d
ev/c
d0
Dir
ecto
ry C
on
ten
ts
#ty
pe
mode
links
use
rgro
up
date
size
loc
4dir
755
2te
am
01
staff
July
10
10:1
5512
10
file
644
1te
am
01
staff
July
11
11:0
0
96
nam
ei-
no
de
subd
ir1
4
myf
ile1
0
Direct
ory
inode T
able
Da
ta
$ vi myfile
Hie
rarc
hic
al S
tru
ctu
re
/
usr
de
vh
om
esb
ine
tcva
rtm
p
tty1
lp0
sub
a
.pro
file
ma
nu
als
test
1
mo
n_
rep
ort
trio
_ltr
wa
lru
s
team
01
team
02
team
03
test
cd
oc
cre
po
rts
pg
ms
bin
exp
ort
s
Pat
hn
ames
A s
equ
ence
of
file
nam
es, se
pa
rate
d b
y sl
ash
es
(/),
th
at
de
scri
be
s th
e p
ath
, th
e s
yste
m m
ust
fo
llow
to l
oc
ate
a
file
in th
e file
sys
tem
Fu
ll p
ath
na
me
(st
art
fro
m th
e /-d
ire
cto
ry):
/home/team01/doc/mon/report
/usr/bin/ls
Re
lativ
e p
ath
na
me
(st
art
fro
m c
urr
en
t d
ire
cto
ry):
./test1
(. =
cu
rre
nt d
ire
cto
ry)
../team03/.profile
(..
= p
are
nt
dire
cto
ry)
Wh
ere
Am
I...?
Th
e p
rin
t w
ork
ing
dir
ecto
ry c
om
ma
nd
ca
n b
e u
sed
to
fin
d o
ut w
ha
t yo
ur
curr
en
t d
ire
cto
ry is
:
$ pwd
/home/team01
Lis
tin
g D
irec
tori
es
To li
st the c
onte
nts
of yo
ur
curr
ent direct
ory
:
$ ls
c doc manuals test1
To
list
all
file
s, in
clu
din
g h
idd
en
(.)
file
s:
$ ls -a
. .. .profile c doc manuals test1
To li
st a
ll fil
es
to t
he e
nd o
f th
e d
irect
ory
tre
e:
$ ls -R
c doc manuals test1
./c:
./doc:
mon_report trio_ltr walrus
Syn
tax
: ls
[ d
irect
ory
]
Lo
ng
Lis
tin
g o
f F
iles
Th
e ls
co
mm
an
d w
ith t
he
-l o
ptio
n c
an
be
use
d to
ob
tain
m
ore
info
rma
tion
ab
ou
t th
e file
s in
a d
ire
cto
ry.
$ ls -l
total 5
drwxrwxr-x
2team01 staff 1024 Aug 12
10:16
cdrwxrwxr-x
2team01
staff 512 Feb 18
09:55
doc
-rwxrwxr-x
1team01
staff 320 Feb 22
07:30
suba
-rwxrwxr-x
2team01 staff 144 Feb 22
16:30
test1
$ ls -li test1
29 -rwxrwxr-x 2 team01 staff 144 Feb 22 16:30 test1
Ch
ang
e C
urr
ent
Dir
ecto
ry
Mo
ve fro
m d
ire
cto
ry /
ho
me/
team
01 t
o /h
om
e/te
am01
/do
c:
$ cd doc
rela
tive p
ath
$ cd /home/team01/doc
full
path
Mo
ve to
yo
ur
ho
me
dire
cto
ry:
$ cd
Mo
ve to
th
e p
are
nt d
ire
cto
ry:
$ c
d ..
Syn
tax
: cd
[ d
irect
ory
]
To c
reate
the d
irect
ory
tes
t, a
s a s
ub-d
irect
ory
of /h
om
e/te
am01
:
$ mkdir /home/team01/test
full
path
nam
e
(or)
$ cd /home/team01
$ mkdir test
rela
tive p
ath
nam
e
Cre
atin
g D
irec
tori
es
Syn
tax
: m
kdir
direct
ory
Act
ivit
y: Q
+ A
1.H
ow
ca
n y
ou
de
term
ine
th
e in
od
e n
um
ber
of
a file
?
2.W
he
re a
re t
he
nam
es a
nd i
no
de
nu
mb
ers
of fil
es
sto
red
?
3.H
ow
ca
n y
ou
de
term
ine
yo
ur
curr
ent
dir
ecto
ry ?
4.H
ow
can y
ou li
st a
ll fi
les
in a
dir
ecto
ry, in
clu
din
g h
idd
en f
iles
?
5.Y
our
curr
ent
direct
ory
is /u
sr/d
t/b
in.
Wh
at
is t
he
ea
sie
st w
ay
to c
ha
ng
e t
o y
ou
r h
om
e d
irec
tory
?
6.W
hic
h file
na
me
s a
re r
elat
ive
?
../team03/dir1 :
/tmp/file1 :
/.profile :
./.profile :
7.W
rite
do
wn
th
e t
hre
e d
iffe
ren
t fi
le t
ypes
th
at A
IX k
no
ws:
a)
b)
c)
Rem
ovi
ng
Dir
ecto
ries
Re
mo
ve th
e d
ire
cto
ry /
ho
me/
team
01/d
oc:
$ rmdir /home/team01/doc
Syn
tax
: rm
dir
direct
ory
The d
irect
ory
must
be e
mpty
!
$ rmdir books
rmdir: books not empty
Cre
ate
mu
ltip
le d
ire
cto
rie
s si
mu
ltan
eo
usl
y:
$ mkdir -p dir1/dir2/dir3
Re
mo
ve a
dire
cto
ry a
nd
all
its s
ub
dire
cto
rie
s:
$ rmdir -p dir1/dir2/dir3
Wo
rkin
g w
ith
Mu
ltip
le D
irec
tori
es
ho
me
/
team
01
dir
1
ho
me
/
team
01
dir
2
dir
3
Dis
pla
yin
g D
irec
tory
In
form
atio
n
$ ls -ldi mydir
51 drwxr-xr-x 2 team01 staff 512 Jan 17 17:38 mydir
$ istat mydir
Inode 51 on device 10/8 Directory
Protection: rwxr-xr-x
Owner: 208(team01)
Group: 1 (staff)
Link count: 2
Length 512 bytes
Last updated:
Mon
Jan 17
21:05:432000
Last modified:
Mon
Jan 17
17:38:522000
Last accessed:
Tue
Jan 18
13:30:002000
AIX
File
nam
es
Should
be d
esc
riptiv
e o
f th
e c
on
ten
t
Sh
ou
ld u
se o
nly
alp
hanum
eric
chara
cters
:U
PP
ER
CA
SE
, lo
werc
ase
, num
ber,
#,
@,
_
Should
not
incl
ude im
bedded b
lan
ks
Should
not
conta
in s
hell
meta
chara
cters
:*
? >
< / ; &
! [ ] |
$ \ '
" (
)
Sh
ou
ld n
ot
begin
with
"+
" or
" -"
sign
Sh
ou
ld n
ot
be the s
am
e a
s a s
yste
m c
om
ma
nd
Are
cas
e se
nsi
tive
File
nam
es
start
ing w
ith a
. (
do
t) a
re h
idd
en
fro
m th
e n
orm
al l
s co
mm
an
d
The m
axim
um
nu
mb
er o
f ch
arac
ters
fo
r a
file
na
me
is 2
55
tou
ch C
om
man
d
Th
e t
ou
ch c
om
mand u
pdate
s th
e a
cces
s and m
od
ific
atio
n
times
of a file
. T
he c
om
mand c
an a
lso b
e u
sed to c
reat
e ze
ro-l
eng
th f
iles.
$ ls -l
-rwxrwxr-x 1 team01 staff 320 Jan 6 07:30 suba
$ date
Thu Sep 10 12:25:00 2000
$ touch suba new_file
$ ls -l
-rwxrwxr-x 1 team01 staff 320 Sep 10 12:25 suba
-rw-r--r-- 1 team01 staff 0 Sep 10 12:25 new_file
Nex
t S
tep
...
Exe
rcis
e 3
Un
it 4
: C
hec
kpo
int
1.U
sing the tre
e s
truct
ure
show
n e
arlie
r, a
nd u
sing /
ho
me
as
your
curr
ent direct
ory
, how
would
you r
efe
r to
the s
ub
a fil
e in
the p
gm
s direct
ory
usi
ng b
oth
full
and r
ela
tive p
ath
nam
es?
____________________________________________________
____________________________________________________
2.W
hen s
peci
fyin
g a
path
nam
e, w
hat is
the d
iffere
nce
betw
een the .
and the ..?
____________________________________________________
____________________________________________________
3.W
hat w
ill the c
d ../.. c
om
mand d
o?
____________________________________________________
____________________________________________________
4.W
hat co
nditi
ons
have
to b
e s
atis
fied in
ord
er
for
the r
md
ir
com
mand to c
om
ple
te s
ucc
ess
fully
? _
___________________________________________________
____________________________________________________
Un
it 4
: C
hec
kpo
int
(Co
nt)
5. M
atc
h the v
arious
optio
ns
of th
e l
s co
mm
and w
ith their
funct
ions.
a.-
a_
_P
rovi
de
s a
lon
g li
stin
g o
f fil
es
b.-
i_
_W
ill li
st h
idd
en
file
sc.
-d_
_L
ist
sub
dire
cto
rie
s a
nd
th
eir c
on
ten
tsd
.-l
__
Dis
pla
ys th
e in
od
e n
um
be
re
.-R
__
Dis
pla
ys in
form
atio
n a
bo
ut a
dire
cto
ry
6. W
hic
h o
f th
e fo
llow
ing
are
va
lid file
na
me
s.a
.1b
.aB
cDe
c.-m
yfile
d.m
y_fil
ee
.my.
file
f.m
y
file
g..
myf
ile
Su
mm
ary
Th
ere
are
th
ree
typ
es
of
file
s w
hic
h a
re s
up
po
rte
d:
Ord
inary
Dire
cto
ryS
pe
cia
l
Th
e A
IX file
sys
tem
str
uct
ure
is a
hie
rarc
hic
al t
ree
File
s a
re a
cce
sse
d u
sin
g e
ithe
r fu
ll o
r re
lativ
e p
ath
n
am
es.
A
fu
ll p
ath
na
me
alw
ays
be
gin
s w
ith a
/ (
forw
ard
sl
ash
)
Th
e fo
llow
ing
co
mm
an
ds
can
be
use
d w
ith d
ire
cto
rie
s:
pw
d, c
d, m
kdir
, rm
dir
an
d ls
Un
it 5
Usi
ng
File
s
Ob
ject
ives
Co
py,
ren
ame
and r
em
ove
file
s
Use
the w
c co
mm
and
Lin
k fil
es
Dis
pla
y th
e co
nte
nts
of a file
with
diff
ere
nt co
mm
ands
Pri
nt
files
After
com
ple
ting this
unit,
stu
dents
should
be a
ble
to:
Co
pyi
ng
File
s
To c
opy
the f
ile /h
om
e/te
am03
/pg
ms/
sub
a to
/ho
me/
team
01/d
oc
and
nam
e it
pro
gra
ma:
$ pwd
/home/team01/doc
$ cp /home/team03/pgms/suba programa
mo
n_
rep
ort
trio
_ltr
wa
lru
s
ho
me
team
01
do
c
mo
n_
rep
ort
pro
gra
ma
trio
_ltr
wa
lru
s
ho
me
team
01
do
c
cp s
ourc
e targ
et
cp
file
1 file
2 ... targ
et_
dir
Exa
mp
les
con
t...
$ cd /home/team01
$ cp doc/programa test1 c
ho
me
team
01
.pro
file
ma
nu
als
tes
t1c
do
c
pro
gra
ma
ho
me
team
01
.pro
file
ma
nu
als
test
1c
pro
gra
ma
pro
gra
ma
tes
t1
do
c
ho
me
team
01
c
trio
_ltr
trio
_ltrd
oc
ho
me
team
01
c
trio
_ltr
do
c
$ cd /home/team01/doc
$ cp trio_ltr ../c
Mo
vin
g a
nd
Ren
amin
g F
iles
$ pwd
/home/team01/c
$ mv trio_ltr t.letter
hom
e
tea
m0
1
c
trio
_ltr
hom
e
team
01
c
t.le
tter
mv
sou
rce
targ
et
Exa
mp
les
con
t...
$ pwd
/home/team01/c
$ mv t.letter ../doc/letter
ho
me
team
01
c
mo
n_r
epo
rt
do
c
ho
me
team
01
c
trio
_ltr
lett
er
do
c
ho
me
team
01
c
trio
_ltr
t.le
tter
do
c
ho
me
team
01
c
mo
n_r
epo
rt
do
c
$ pwd
/home/team01/c
$ mv ../doc/mon_report .
Lis
tin
g F
ile C
on
ten
ts
$ cat walrus
"The time has come," the Walrus said,
"To talk of many things:
Of shoes - and ships - and sealing wax -
Of cabbages - and kings -
And why the sea is boiling hot -
And whether pigs have wings."
From The Walrus And The Carpenter
by Lewis Carroll (1871)
cat
file
1 fi
le2
...
Dis
pla
yin
g F
iles
pg
file
nam
em
ore
file
nam
e
$ pg walrus (or) $ more walrus
"The time has come," the Walrus said,
"To talk of many things:
Of shoes - and ships - and sealing wax -
Of cabbages - and kings -
And why the sea is boiling hot -
And whether pigs have wings."
: <Enter>
one p
age a
t a tim
e
wc
Co
mm
and
The w
c co
mm
an
d c
ou
nts
th
e n
um
be
r o
f lin
es,
wo
rds
an
d b
yte
s in
a
na
me
d file
:
$ wc [-c] [-l] [-w] filename
Optio
ns:
-cco
un
ts t
he
nu
mb
er
of
byt
es
-lco
un
ts li
ne
s-w
cou
nts
wo
rds
Exa
mp
le:
$ wc myfile
17
12
610
85
m
yfile
chara
cters
word
s
line
s
Act
ivit
y: W
ork
ing
wit
h t
he
wc
Co
mm
and
Act
ivity
Lin
kin
g F
iles
Th
e ln
com
mand a
llow
s one f
ile t
o h
ave
mo
re t
han
on
e n
ame:
$ pwd
/home/team01
$ ln manuals /home/team02/man_files
ln s
ourc
e_fil
e targ
et_
file
Both
copie
s use
the s
am
e in
ode
Rem
ovi
ng
File
s
$ ls
mon_report trio_ltr walrus
$ rm mon_report
$ ls
trio_ltr walrus
$ rm -i walrus
rm: Remove walrus: y
$ ls
trio_ltr
rm file
1 file
2 file
3 ...
-i: R
em
ove
a file
inte
ract
ively
Pri
nti
ng
File
s
To q
ueue f
iles
to t
he p
rinte
r use
the q
prt
co
mm
an
d:
$ qprt filename filename2 filename3 ....
The q
chk
com
ma
nd
dis
pla
ys t
he
cu
rre
nt
sta
tus
of
a p
rin
t q
ue
ue
:
$ qchk
Queue
Dev Status Job Files User PP %
Blks Cp
Rnk
lp0
lp0 Running 99 walrus team01 1 1 1 1
To
ca
nce
l yo
ur
prin
t jo
b u
se th
e q
can
com
mand:
$ qcan -x 99
Job n
um
ber
Exe
rcis
e 4
Nex
t S
tep
...
Un
it 5
: C
hec
kpo
int
1.W
hat is
the e
ffect
of th
e follo
win
g c
om
mands?
$ c
d /hom
e/team
01
$ c
p file
1 file
2 _
____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
2.W
hat is
the e
ffect
of th
e follo
win
g c
om
mands?
$ c
d /hom
e /te
am
01
$ m
v fil
e1 n
ew
file
_____________________________________________________________
_____________________________________________________________
3.W
hat is
the e
ffect
of th
e follo
win
g c
om
mands?
$ c
d /hom
e /te
am
01
$ In n
ew
file m
yfile
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
4.L
ist co
mm
ands
that ca
n b
e u
sed to v
iew
the c
onte
nts
of a file
. _
____________________________________________________________
Su
mm
ary
Th
e c
p c
om
ma
nd
ca
n b
e u
sed
to
co
py
file
s
Th
e m
v c
om
ma
nd
ca
n b
e u
sed
to
mo
ve a
nd
re
na
me
file
s
Th
e In
co
mm
an
d c
an
be
use
d to
cre
ate
ad
diti
on
al n
am
es
for
a file
Dis
pla
y th
e c
on
ten
ts o
f a
file
usi
ng
cat
, p
g o
r m
ore
Use
th
e r
m c
om
ma
nd
to
de
lete
file
s
Use
th
e q
prt
co
mm
an
d to
prin
t fil
es
Th
e w
c-co
mm
an
d c
ou
ld b
e u
sed
to
co
un
t w
ord
s o
r lin
es
fro
m file
s o
r co
mm
an
d o
utp
ut
Un
it 6
File
P
erm
issi
on
s
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Lis
t th
e b
asic
file
per
mis
sio
ns
Ch
ang
e th
e b
asi
c fi
le p
erm
issi
on
s u
sin
g b
oth
th
e
oct
al a
nd
sym
bo
lic fo
rma
ts
Lo
ng
Lis
tin
g o
f F
iles
The ls
co
mm
an
d w
ith t
he -
l optio
n c
an b
e u
sed t
o o
bta
in m
ore
in
form
atio
n a
bo
ut th
e file
s in
a d
ire
cto
ry.
$ ls -l
drwxrwxr-x
2team01
staff 1024
Aug 12
10:16c
drwxrwxr-x
2team01
staff 512
Feb 18
09:55doc
-rwxrwxr-x
1team01
staff 320
Feb 22
07:30suba
-rwxrwxr-x
2team01
staff 144
Feb 22
16:30test1
pe
rmis
sio
nbits
F
or
an
ord
inar
y fil
e:
r => Can look at the contents of a file
w => Can change or delete the contents of a file
x => Can use the file name as a command
(r is
als
o n
ee
de
d)
F
or
a d
irec
tory
:
r => Can find out what files are in the directory
w => Can create/remove files in the directory (x is needed)
x => Has permission to be in the directory
(that is, cd to the directory or access files from the
directory)
File
Pro
tect
ion
/Per
mis
sio
ns
rwx
rwx
rwx
use
rg
rou
po
the
rs
r =
re
ad
w =
write
x
= e
xecu
te
Ch
ang
ing
Per
mis
sio
ns
(Sym
bo
lic N
ota
tio
n)
u =
ow
ner
of
the f
ileg
= o
wner's
gro
up
o =
oth
er
use
rs o
n th
e s
yste
ma
= a
ll
$ ls -l newfile
-rw-r--r--
1team01
staff58Apr 21
16:06newfile
$ chmod go+w newfile
$ ls -l newfile
-rw-rw-rw-
1team01
staff58Apr 21
16:06newfile
$ chmod a+x newfile
$ ls -l newfile
-rwxrwxrwx
1team01
staff58Apr 21
16:06newfile
$ chmod o-rwx newfile
$ ls -l newfile
-rwxrwx---
1team01
staff58Apr 21
16:06newfile
chm
od
m
ode fil
enam
e
+ :
add p
erm
issi
ons
- :
rem
ove
pe
rmis
sio
ns
= :
Cle
ars
pe
rmis
sio
ns
an
d s
ets
to
mo
de
sp
eci
fied
Ch
ang
ing
Per
mis
sio
ns
(Oct
al N
ota
tio
n)
File
and d
irect
ory
perm
issi
ons
can b
e s
peci
fied in
the s
ymbolic
sy
nta
x o
r a
s a
n o
ctal
nu
mb
er:
To
ch
an
ge
pe
rmis
sio
ns
so t
he
ow
ne
r a
nd g
roup h
ave
read a
nd
wri
te p
erm
issi
on
s a
nd
oth
ers
read o
nly
:
$ ls -l newfile
-rw-r--r--
1team01
staff58Apr 21
16:06newfile
$ chmod 664 newfile
$ ls -l newfile
-rw-rw-r--
1team01
staff65Apr 22
17:06newfile
Oth
ers
r--
10
04
+0
+0
4
Gro
up
rw-
110
4+
2+
06
Use
rrw
x11
14
+2
+1
7
Sym
bo
licB
ina
ry
Oct
al
Def
ault
File
Per
mis
sio
ns
The d
efa
ult
pro
tect
ions
for
new
ly c
reate
d f
iles
and d
irect
ories
are
:
These
defa
ult
settin
gs
may
be c
hanged b
y ch
angin
g the u
mas
k va
lue.
File
-rw
-r--
r--
6
44
Dire
cto
ryd
rwxr
-xr-
x75
5
um
ask
um
ask
sp
eci
fies
wh
at p
erm
issi
on
bits
will
be
se
t o
n a
n
ew f
ile o
r d
irec
tory
wh
en
cre
ate
d.
It
is a
n o
ctal
n
um
ber
th
at
is u
sed
to
de
term
ine
wh
at
pe
rmis
sio
n b
its a
fil
e o
r d
ire
cto
ry is
cre
ate
d w
ith:
New Directory: 777 - 022: 755 => rwxr-xr-x
New File: 666 - 022: 644 => rw-r--r--
Th
e d
efa
ult
valu
e o
f 02
2 is
se
t in
/etc
/sec
uri
ty/u
ser.
It
can
be
ch
an
ge
d fo
r a
ll u
sers
or
for
a s
pe
cific
use
r.
Act
ivit
y: P
erso
nal
Dir
ecto
ries
Act
ivity
Wri
te P
erm
issi
on
on
a D
irec
tory
$ ls -ld /home/team01
drwxrwxrwx 2 team01 staff 512 July 29 9:40 team01
$ ls -l /home/team01/file1
-rw-r--r-- 1 team01 staff 1300 July 30 10:30 file1
$ whoami
team02
$ vi /home/team01/file1
file1: The file has read permission only
$ vi myfile1
Ha! Ha! I changed this file. Figure out how.
$ mv myfile1 /home/team01/file1
override protection 644 for file1? y
$ cat /home/team01/file1
Ha! Ha! I changed this file. Figure out how.
Fu
nct
ion
/Per
mis
sio
ns
Req
uir
ed
Co
mm
and
So
urc
e D
irec
tory
So
urc
e F
ileTa
rget
Dir
ecto
ry
cdx
N/A
N/A
lsr
N/A
N/A
ls -
lr,
xN
/AN
/A
mkd
irx w
(p
are
nt)
N/A
N/A
rmd
irx w
(p
are
nt)
N/A
N/A
cat,
pg
, m
ore
xr
N/A
mv
x, w
NO
NE
x, w
cpx
rx,
w
tou
chx,
w *
NO
NE
N/A
rmx,
wN
ON
EN
/A
Nex
t S
tep
...
Exe
rcis
e 5
Un
it 6
: C
hec
kpo
int
The follo
win
g q
uest
ions
are
for
a file
calle
d r
epo
rta
wh
ich
ha
s th
e fo
llow
ing
se
t of
perm
issi
ons:
rw
xr-x
r-x
1.W
ha
t is
th
e m
od
e in
oct
al?
_________________________________________________________
2.C
hange m
ode to r
wxr
- -
r- -
usi
ng the s
ymbolic
form
at.
_________________________________________________________
3.R
epeat th
e a
bove
opera
tion u
sing the o
ctal f
orm
at.
_________________________________________________________
4.Q
uest
ion four
is b
ase
d o
n the follo
win
g li
stin
g. A
ssum
e that th
e d
irect
ory
jo
bs
conta
ins
the file
job
log
. $ ls -lR
total 8
drwxr-xr-x 2 judy finance 512 June 5 11:08 jobs
./jobs:
total 8
-rw-rw-r-- 1 judy finance 100 June 6 12:16 joblog
Can F
red, w
ho is
a m
em
ber
of th
e fin
ance
gro
up, m
odify
the file
jo
blo
g?
Un
it 6
: C
hec
kpo
int
(Co
nt)
5. Q
uest
ion fiv
e is
base
d o
n the follo
win
g li
stin
g. A
ssum
e that th
e
direct
ory
jo
bs
conta
ins
the d
irect
ory
wo
rk, w
hic
h in
turn
conta
ins
the
file
job
log
.
$ ls -lR
total 8
drwxrwxr-x 3 judy finance 512 June 5 11:08 jobs
./jobs:
total 8
drwxrw-r-x 2 judy finance 512 June 5 11:10 work
./jobs/work:
total 8
-rw-rw-r-- 1 judy finance 100 June 6 12:16 joblog
Ca
n F
red
, w
ho
is a
me
mb
er
of th
e fin
an
ce g
rou
p, m
od
ify th
e file
job
log
?
Un
it 6
: C
hec
kpo
int
(Co
nt)
6. Q
uest
ion s
ix is
base
d o
n the follo
win
g li
stin
g. A
ssum
e that th
e d
irect
ory
j
ob
s co
nta
ins
the
dire
cto
ry w
ork
, w
hic
h in
turn
conta
ins
the file
jo
blo
g.
$ ls -lR
total 8
drwxr-xr-x 3 judy finance 512 June 5 11:08 jobs
./jobs:
total 8
drwxrwxrwx 2 judy finance 512 June 5 11:10 work
./jobs/work:
total 8
-rw-rw-r-- 1 judy finance 100 June 6 12:16 joblog
Can F
red, w
ho is
a m
em
ber
of th
e fin
ance
gro
up, co
py
the file
jo
blo
g to
his
ho
me
dire
cto
ry?
Su
mm
ary
Bas
ic f
ile p
erm
issi
on
s ca
n b
e li
ste
d u
sin
g th
e ls
-l
com
ma
nd
chm
od
gra
nts
or
rem
ove
s re
ad
, w
rite
an
d e
xecu
te
pe
rmis
sio
ns
for
thre
e c
lass
es
of
use
rs:
use
r , g
rou
p a
nd
o
ther
s
Th
e p
erm
issi
on
s u
sed
with
th
e c
hm
od
co
mm
an
d c
an
be
d
efin
ed
in s
ymb
olic
or
oct
al f
orm
at
Th
e u
mas
k s
pe
cifie
s th
e p
erm
issi
on
s fo
r n
ew
file
s a
nd
d
ire
cto
rie
s
Un
it 7
Th
e vi
Ed
ito
r
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Cre
ate
and e
dit
file
s
Man
ipu
late
tex
t w
ithin
a file
Set up d
efau
lts
for
the
vi e
dito
r
Exe
cute
co
mm
and
-lin
e ed
itin
g
De
fine
th
e u
ses
for
the
oth
er f
orm
s o
f vi
vi F
ull-
scre
en e
dito
r
Tw
o m
od
es o
f o
pe
ratio
n:
com
man
d a
nd
tex
t
Util
ize
s o
ne-
lett
er c
om
man
ds
Do
es
no
t fo
rma
t te
xt
Fle
xib
le s
ea
rch
an
d r
ep
lace
fa
cilit
y w
ith p
atte
rn
mat
chin
g
Allo
ws
for
use
r-d
efin
ed
ed
itin
g fu
nct
ion
s u
sin
g m
acro
s
Sta
rtin
g v
i
$ vi vifile
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "vifi
le"
[N
ew
file
]
If t
he
file
"vi
file
" does
not
exi
st,
it w
ill b
e c
reate
d
Oth
erw
ise,
vi w
ill o
pen t
he e
xist
ing f
ile
Ad
din
g T
ext
$ vi vifile
keys
tro
kei
This
file
is b
ein
g c
reate
d u
sing the
vi e
dito
r.T
o le
arn
mo
re a
bo
ut
the
vi e
dito
r,lo
ok
in th
e "
Co
mm
an
ds
Re
fere
nce
" m
an
ua
lu
nd
er
vi.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Exi
tin
g t
he
Ed
ito
r
$ vi vifile
keys
troke
:
<E
sc>
Th
is fi
le is
bei
ng c
reate
d u
sing
the
vi e
dito
r.T
o le
arn
more
ab
out t
he v
i edi
tor,
look
in the "
Com
mands
Refe
rence
" m
anual
unde
r vi
.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ :wq
To
qu
it w
ith
ou
t sa
ving:
:q
!T
o s
ave
and e
xit :
:x or
:w
q or
<sh
ift-
zz>
$
_
Cu
rso
r M
ove
men
t
1G
<ct
rl -
b>
H k<
up
- a
rro
w>
<d
ow
n -
arr
ow
> j
L
<
ctrl -
f>
G
0
b,B
h
<le
ft -
arr
ow
>
$
w
, W
l
<
right -
arr
ow
>
Del
etin
g T
ext
To d
ele
te a
sin
gle
ch
arac
ter:
x
To
de
lete
to
th
e e
nd
of
the
curr
ent
wo
rd:
dw
To d
ele
te to the e
nd
of
the
line:
d
$
To d
ele
te to the s
tart
of
the
line
:d
0
To
de
lete
th
e w
ho
le li
ne
:d
d
To d
ele
te a
ran
ge
of
lines
::2
0,40
d
Un
do
th
e la
st c
ha
ng
e:
u
Sea
rch
fo
r a
Pat
tern
$ vi vifile
keys
tro
ke:
<Esc>
n
Thi
s fil
e is
bein
g c
reate
d u
sing th
evi
edito
r.
To
learn
more
ab
ou
t th
evi
edito
r,lo
ok
in the "
Com
mands
Refe
rence
" m
anual
und
er
vi.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ /th
e To
se
arc
h fo
rwa
rd, u
se /t
ext
To
se
arc
h b
ack
wa
rd,
use
?te
xt
Act
ivit
y: M
emo
rize
Act
ivit
y
Ass
ign t
he f
ollo
win
g v
i com
mands:
a, i,
u, x,
dd, G
, 1G
, E
SC
, :q
!, :w
q
Qu
it w
itho
ut
savi
ng
:
Dele
te t
he w
hole
line:
Exi
t fr
om
te
xt m
od
e:
Add text
after
curs
or:
Undo t
he la
st c
hange:
Go to the la
st li
ne:
De
lete
a s
ing
le c
ha
ract
er:
Inse
rt text
at th
e c
urs
or:
Write
ch
an
ge
s a
nd
qu
it:
Go t
o t
he f
irst
line:
Ch
ang
ing
Te
xt
$ vi vifile
keys
troke
:<
Esc
>
Text
can b
e r
epla
ced b
y ove
rtyp
ing:
Rnew
text
Word
s ca
n b
e c
hanged:
c2w
Or
eve
ry o
ccurr
ence
of a w
ord
can b
e s
ubst
itute
d for
anoth
er
word
(s)
Th
is file
is b
ein
g c
rea
ted
usi
ng
th
evi
ed
itor.
To
lea
rn m
ore
ab
ou
t th
e o
ne
and
on
ly v
i ed
itor,
loo
k in
th
e o
ne
and
on
ly "
Co
mm
an
ds
Re
fere
nce
"m
an
ua
l un
de
r vi
.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ :g/ the /s// the one and only /g
Mo
vin
g T
ext
Th
is is
th
e f
irst
lin
e o
f te
xt_
Th
is is
th
e se
con
d li
ne
of
text
Th
is is
th
e t
hird
lin
e o
f te
xt
Th
is is
th
e f
irst
lin
e o
f te
xt_
Th
is is
th
e th
ird
lin
e o
f te
xt
Th
is is
th
e f
irst
lin
e o
f te
xtT
his
is t
he
th
ird
lin
e o
f te
xt_
Th
is is
th
e se
con
d li
ne
of
text
Co
mm
an
ds
dd
p
Mo
vin
g is
done b
y d
elet
ing
th
e o
rig
inal
tex
t usi
ng d
d
Co
pyi
ng
is d
one b
y yy
anki
ng
text
into
a b
uffer
In b
oth
ca
ses,
th
e te
xt is
pa
ste
d in
to it
s n
ew
loca
tion
vi -
Exe
cuti
ng
AIX
Co
mm
and
s
Th
e f
ollo
win
g s
ho
uld
be s
tock
ed
in t
he
em
plo
yee
bre
ak
roo
m:
~ ~ ~
$ vi myfile
keys
troke
:
<E
sc>
:!ls
file1
file
2
snack
s[H
it re
turn
to c
ontin
ue]
:r snacks
Th
e f
ollo
win
g s
ho
uld
be s
tock
ed
in t
he
em
plo
yee
bre
ak
roo
m:
can
dy
ba
rsso
da
pop
po
pco
rn
vi O
pti
on
s
Op
tio
ns
en
tere
d in
th
e v
i se
ssio
n c
ha
ng
e t
he
be
ha
vio
r o
f th
e v
i com
mand
:se
t a
ll:s
et
au
toin
de
nt
/ n
oa
uto
ind
en
t:s
et
nu
mb
er
/ n
on
um
be
r:s
et
list
/ nolis
t:s
et
sho
wm
od
e /
no
sho
wm
od
e:s
et
tab
sto
p=
x:s
et
ign
ore
case
/ n
oig
no
reca
se:s
et
wra
pm
arg
in=
5
Op
tion
s ca
n b
e s
tore
d in
th
e file
$H
OM
E/.e
xrc
Mac
ros
ca
n b
e w
ritt
en
an
d n
ew
co
mm
an
ds
cre
ate
d
Co
mm
and
-Lin
e E
dit
ing
$ set -o vi
Remember:
hj
kl
Use
s sa
me
ed
itin
g k
eys
as
vi
Ca
n c
orr
ect
mis
take
s in
th
e c
urr
en
t lin
e
Use
s e
dito
r ke
ys t
o e
dit
/re-
ente
r p
revi
ou
s lin
es
vi E
dit
ors
viF
ull-
scre
en, fu
ll-fu
nct
ion e
dito
r
view
R
ead o
nly
form
of vi
, ch
anges
cannot be
save
d u
nle
ss o
verr
idden w
ith a
forc
e (
!)
ved
itB
egin
ners
vers
ion o
f vi
, sh
ow
mode is
on
by
defa
ult.
ex, e
dS
ubse
t of vi
work
ing in
line m
ode, ca
n
acc
ess
the s
creen e
diti
ng c
apabili
ties
of v
i
edit
S
imple
form
of ex
Nex
t S
tep
...
Exe
rcis
e 6
Un
it 7
: C
hec
kpo
int
1.W
hen u
sing the v
i edito
r, w
hat are
the tw
o m
odes
of opera
tion?
____________________________________________________
2.W
hile
usi
ng v
i, how
do y
ou g
et to
com
mand m
ode?
____________________________________________________
____________________________________________________
____________________________________________________
3.W
hic
h o
f th
e follo
win
g c
ould
you u
se to e
nte
r in
text
?a x i d
d
4.W
hile
in c
om
mand m
ode, pre
ssin
g the u
key
repeate
dly
will
"u
ndo"
all
pre
viousl
y ente
red c
om
mands.
Tru
e o
r F
als
e?
5.v
i can b
e u
sed to g
lobally
change the first
occ
urr
ence
of a p
attern
on e
very
line w
ith a
giv
en p
attern
. T
rue o
r F
als
e?
Su
mm
ary
Th
e v
i co
mm
an
d s
tart
s a
fu
ll-sc
ree
n e
dito
r
vi h
as
two
mo
de
s o
f o
pe
ratio
n: te
xt in
pu
t m
od
e a
nd
co
mm
an
d m
od
e
vi m
ake
s a
co
py
of
the
file
yo
u a
re e
diti
ng
in a
n e
dit
bu
ffe
r. T
he
co
nte
nts
are
no
t ch
an
ge
d u
ntil
yo
u s
ave
th
e
cha
ng
es
Su
bco
mm
an
ds
with
th
e :, /,
?, ! re
ad
inp
ut fr
om
a li
ne
d
isp
laye
d a
t th
e b
ott
om
of th
e s
cre
en
Un
it 8
Sh
ell B
asic
s
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Use
wild
card
s to
acc
ess
file
s w
ith s
imila
r nam
es.
Use
red
irec
tio
n a
nd p
ipes
to
co
ntr
ol t
he
inp
ut
and
ou
tpu
t o
f p
roce
sse
s.
Use
lin
e co
nti
nu
atio
n to
en
ter
com
ma
nd
s th
at sp
an
th
e
com
ma
nd
lin
e.
Gro
up
co
mm
and
s in
ord
er
to c
on
tro
l th
eir e
xecu
tion
.
Th
e S
hel
l
Ko
rn (
ksh
) o
r B
ou
rne
(b
sh)
or
C (
csh
)
Use
r in
terf
ace
to A
IX
Co
mm
and
inte
rpre
ter
En
ab
les
mu
ltip
le t
asks
Co
mp
reh
en
sive
pro
gra
mm
ing
lan
gu
age
Met
ach
arac
ters
an
d W
ildca
rds
Met
ach
arac
ters
are
ch
ara
cte
rs t
ha
t th
e s
he
ll in
terp
rets
a
s h
avi
ng
a s
pec
ial m
ean
ing
.
Exa
mp
les:
< >
|
; ! *
?
[ ] $ \ "
' '
Wild
card
s a
re a
su
bse
t o
f m
eta
cha
ract
ers
th
at a
re u
sed
to
sea
rch
fo
r and m
atch
file
pat
tern
s.
Exa
mp
les:
*?
![
][
-]
Ch
arac
ter
Su
bst
itu
tio
n i
n F
ile N
ames
/
hom
e
tea
m0
1
te
st1
te
st1
.2
test
1.3
m
yfile
n
e
ne
t
ne
w
ne
st
few
Wild
card
s:
*?
One c
hara
cter
com
pare
:
$ ls ne?
net new
$ rm ?e?
few net new
Multi
ple
chara
cter
com
pare
:
$ cp n* /tmp
ne net
new nest
$ qprt *w
new few
$ echo test1*
test1 test1.2 test1.3
Ch
arac
ter
Su
bst
itu
tio
n i
n F
ile N
ames
Incl
usi
ve L
ists
:[
]!
[
- ]
$ ls ne[stw]
net new
$ rm [fghjdn]e[tw]
few net new
$ ls *[1-5]
test1 test1.2 test1.3
$ qprt [!tn]*
myfile few
$ cat ?[!y]*[2-5]
test1.2 test1.3
/
hom
e
tea
m0
1
te
st1
te
st1.2
te
st1.3
m
yfile
n
e
ne
t
ne
w
ne
st
few
Th
e S
tan
dar
d F
iles
standard
in (
0)
standard
err
or
(2)
standard
out (1
)
cmd
Th
ree
des
crip
tors
are
ass
ign
ed
by
the
sh
ell
wh
en
th
e p
rog
ram
st
art
s:
File
Des
crip
tors
Sta
nd
ard
in:
<0
Sta
nd
ard
ou
t:>
1
Sta
nd
ard
err
or:
2>
2
Inp
ut
Red
irec
tio
n
Def
ault
sta
nd
ard
inp
ut
$ mail team01
Subject: Letter
This is a letter.
<ctrl-d>
Cc:
$ _
Red
irec
t in
pu
t fr
om
a f
ile:
<
$ mail team01 < letter
$ _
Ou
tpu
t R
edir
ecti
on
Def
ault
sta
nd
ard
ou
tpu
t:
$ls
file1file2 file3
Red
irec
t o
utp
ut
fro
m a
file
: >
$ls >ls.out
$ _
Red
irec
tin
g a
nd
ap
pen
din
g o
utp
ut
to a
file
:>
>
$ who>> whos.there
$ _
Cre
atin
g a
File
wit
h c
atW
hile
norm
ally
use
d to li
st the c
onte
nts
of fil
es,
usi
ng c
at w
ith r
edirect
ion c
an
be u
sed to c
reate
a file
:
$ ls
letter acctfile file1
$ cat file1
This is a test file.
The file has 2 lines.
$ _
Usi
ng r
edir
ecti
on
:
$ cat > newfile
This is line 1 of the file.
This is the 2nd line.
And the last.
<ctrl-d>
$ ls
letter acctfile file1 newfile
Act
ivit
y: R
evie
w S
hel
l B
asic
s
1.W
hic
h f
iles
are
list
ed
wh
en
th
e f
ollo
win
g c
om
ma
nd
s a
re e
xecu
ted
?
$ ls /home/team01/*.?
$ ls /tmp/[a-zA-Z]*.[0-9]
2. T
rue
or
Fal
se: T
he
co
mm
an
d "ls *"
lists
all
file
s in
a d
ire
cto
ry.
3.W
rite
do
wn
th
e f
ile
des
crip
tors
fo
r th
e fo
llow
ing
co
mm
an
d:
$ wc -l < file1 > /tmp/lines
Sta
ndard
input:
Sta
ndard
outp
ut:
Sta
ndard
err
or:
4.Y
ou
wa
nt
to a
pp
en
d f
ile testfile1
to
file
report99
. W
hic
h c
om
ma
nd
is c
orr
ect
?
o cat report99 < testfile1
o cat testfile1 > report99
o cat testfile1 report99
o cat testfile1 >> report99
Err
or
Red
irec
tio
n
Def
ault
sta
nd
ard
err
or:
$ cat filea fileb
This is output from filea.
cat: cannot open fileb
Red
irec
tin
g e
rro
r o
utp
ut
to a
file
: 2
> (
To
ap
pen
d:
2>>
)
$ cat filea fileb 2> errfile
This is output from filea
$ cat errfile
cat: cannot open fileb
$ cat filea fileb 2> /dev/null
This is output from filea
Co
mb
ined
Red
irec
tio
n
Co
mb
ined
red
irec
ts:
$ command > outfile 2> errfile < infile
$ command >> appendfile 2>> errfile < infile
Ass
oci
atio
n E
xam
ple
s:
R
edirect
sta
ndard
err
or
to s
tandard
out:
$ command > outfile 2>&1
C
AU
TIO
N:
Th
is is
NO
T t
he
sa
me
as
ab
ove
$ command 2>&1 > outfile
Pip
es
A s
equence
of one o
r m
ore
com
mands
separa
ted b
y a v
ert
ical b
ar
"|"
is
calle
d a
pip
e. T
he s
tan
dar
d o
utp
ut
of each
com
mand b
eco
mes
the
stan
dar
d in
pu
t of
the n
ext
com
mand.
$ who | wc -l
4
This
is t
he s
am
e a
s:
$ who > tempfile
$ wc -l tempfile
4tempfile
$ rm tempfile
Filt
ers
A f
ilter
is a
com
mand t
hat re
ads
fro
m s
tan
dar
d in
, tr
ansf
orm
s th
e in
pu
t in
so
me
wa
y, a
nd
wri
tes
to s
tan
dar
d
ou
t.
Exa
mp
le:
ls -l | grep "^d" | wc -l
Lo
ng li
stin
g o
f all
files:
-rw
xr-x
r-x
... fil
e1
drw
xr-x
r--
...
dir1
-rw
xr--
r--
...
file2
Fin
d a
ll lin
es
that
be
gin
with
a "
d":
drw
xr-x
r--
...
dir1
Co
unt
all
lines
(dire
cto
rie
s)
Sp
lit O
utp
uts
Th
e t
ee c
om
mand r
eads
standard
input
and s
ends
the d
ata
to
both
sta
ndard
outp
ut and a
file
.
ls | tee /tmp/ls.save | wc -l
cow
fox
ox
/tm
p/ls
.sav
e
3
cow
fox
oxtee
lsw
c-l
Co
mm
and
Gro
up
ing
Mu
ltip
le c
om
ma
nd
s ca
n b
e e
nte
red
on
th
e s
am
e li
ne
, se
pa
rate
d b
y a
se
mi-co
lon
";"
:
$ ls -R > outfile ; exit
is e
qu
iva
len
t to
en
terin
g:
$ ls -R > outfile
$ exit
Lin
e C
on
tin
uat
ion
Th
e b
ack
sla
sh (
\) c
an
be
use
d to
co
nti
nu
e a
com
man
d
on
a s
epar
ate
line.
A
sec
on
dar
y p
rom
pt
char
acte
r ">
" is
issu
ed b
y th
e s
hell
to i
nd
icat
e lin
e co
nti
nu
atio
n.
$ cat
/home/mydir/mysubdir/mydata\
> /home/yourdir/yoursubdir/yourdata
Nex
t S
tep
...
Exe
rcis
e 7
Exe
rcis
e 7
Un
it 8
: C
hec
kpo
int
1.W
hat w
ill the follo
win
g c
om
mand m
atc
h $
ls
???[!a-z
]*[0
-9]t
___________________________________________________
___________________________________________________
2.F
or
quest
ions
2-4
, in
dic
ate
where
the s
tandard
input, s
tandard
outp
ut and
standard
err
or
will
go.
$ c
at
file1
1. st
andard
input (0
): 2. st
andard
outp
ut (1
): 3. st
andard
err
or
(2):
___________________________________________________
___________________________________________________
3. $
tim
<
le
tter
1. st
andard
input (0
): 2. st
andard
outp
ut (1
): 3. st
andard
err
or
(2):
___________________________________________________
_______________________________________________
Un
it 8
: C
hec
kpo
int
(Co
nt)
4. $
cat .p
rofil
e >
new
pro
file 2>
1 1. st
andard
input (0
): 2. st
andard
outp
ut (1
): 3. st
andard
err
or
(2):
___________________________________________________
___________________________________________________
___________________________________________________
For
quest
ions
5, 6 a
nd 7
, cr
eate
com
mand li
nes
to d
ispla
y th
e c
onte
nt of
file
a usi
ng c
at a
nd then p
erf
orm
the follo
win
g:
5. P
lace
the o
utp
ut of th
e c
om
mand in
file
b a
nd the e
rrors
in f
ilec.
___________________________________________________
6. P
lace
the o
utp
ut of th
e c
om
mand in
file
b a
nd a
ssoci
ate
any
err
ors
w
ith the o
utp
ut in
file
b.
___________________________________________________
7.
Pla
ce the o
utp
ut in
file
b a
nd d
isca
rd a
ny
err
or
mess
ages.
(D
o n
ot
dis
pla
y or
store
err
or
mess
ages.
) _
__________________________________________________
Su
mm
ary
Wild
card
s, *
and ?
, pro
vide a
conve
nie
nt
way
for
speci
fyin
g
mu
ltip
le file
s o
r d
ire
cto
ry n
am
es.
Th
e w
ildca
rd n
ota
tion
[ ]
is li
ke u
sin
g t
he
? b
ut
it a
llow
s yo
u t
o
cho
ose
sp
eci
fic c
ha
ract
ers
to
be
ma
tch
ed
.
Th
ree
file
s a
uto
ma
tica
lly o
pe
ne
d fo
r re
dire
ctio
n a
re s
tan
da
rd in
, st
an
da
rd o
ut,
an
d s
tan
da
rd e
rro
r.
I/O
re
dire
ctio
n a
lters
th
e d
efa
ult
inp
ut
sou
rce
or
ou
tpu
t d
est
ina
tion
o
f a
co
mm
an
d.
A p
ipe
pa
sse
s th
e o
utp
ut
of
on
e c
om
ma
nd
dire
ctly
to
th
e in
pu
t o
f a
no
the
r co
mm
an
d.
A f
ilte
r ta
kes
inp
ut
fro
m s
tan
da
rd in
, tr
an
sfo
rms
it, a
nd
se
nd
s th
e
ou
tpu
t to
sta
nd
ard
ou
t.
tee
take
s in
pu
t a
nd
ro
ute
s it
to t
wo
pla
ces,
sta
nd
ard
ou
t a
nd
a
file
.
Un
it 9
Usi
ng
Sh
ell
Var
iab
les
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Lis
t va
riab
les
th
at d
efin
e y
ou
r en
viro
nm
ent
Set
, re
fere
nce
, and d
elet
e va
riable
issu
es
De
fine
th
e u
se o
f th
e fo
llow
ing
qu
oti
ng
met
ach
arac
ters
:d
ou
ble
qu
ote
s "
sin
gle
qu
ote
s '
ba
cksl
ash
\
Pe
rfo
rm c
om
man
d s
ub
stit
uti
on
Ob
ject
ives
Sh
ell V
aria
ble
s
Var
iab
les
repre
sent data
whose
valu
e m
ay
change
Sh
ell v
aria
ble
s defin
e y
our
envi
ron
men
t:
HO
ME
Direct
ory
(su
ch a
s /h
om
e/team
01)
TE
RM
inal T
ype (
such
as
ibm
3151)
Searc
h P
AT
H (
such
as
/bin
:/usr
/bin
:/etc
:.)
Ad
dit
ion
al v
aria
ble
s ca
n b
e d
efin
ed
Lis
tin
g V
aria
ble
Set
tin
gs
$ set
HOME=/home/team01
PATH=/bin:/usr/bin:/etc:/home/team01/bin:.
PS1=$
PS2=>
SHELL=/usr/bin/ksh
TERM=ibm3151
xy=day
$ _
Set
tin
g a
nd
Ref
eren
cin
g S
hel
l V
aria
ble
s
1. T
o a
ssig
n a
val
ue
to a
shell
variable
:
name=value
2. T
o r
efer
ence
a v
aria
ble
, p
refix
its
na
me
with
a $
-sig
n:
$xy="hello world"
$echo $xy
hello world
3. T
o d
elet
e a
vari
able
, u
se t
he
un
set
com
mand
$unsetxy
$echo $xy
$
_
Sh
ell
Var
iab
les
Exa
mp
le
$ xy=day
$ echo $xy
day
$ echo Tomorrow is Tues$xy
Tomorrow is Tuesday
$ echo There will be a $xylong meeting
There will be a meeting
$ echo There will be a ${xy}long meeting
There will be a daylong meeting
Co
mm
and
Su
bst
itu
tio
n
V
ariable
=`O
utp
ut
from
a C
om
mand`
$ date
Wed 12 Jan 11:38:39 2000
$ now=$(date)
(or now=`date`)
$ echo $now
Wed 12 Jan 11:38:39 2000
$ users=$(who) (or users=`who`)
$ echo $users
team01 tty0 Sep 12 08:18
team02 tty1 Sep 12 09:00
Qu
oti
ng
Met
ach
arac
ters
'' S
ing
le Q
uo
tes:
$ echo '$HOME'
$HOME
""
Do
ub
le Q
uo
tes:
$ echo "$HOME"
/home/team01
\B
acks
lash
:
$ echo \$HOME
$HOME
Ignore
s th
e s
peci
al
meanin
g o
f th
e f
ollo
win
g
chara
cter
Ignore
s all
meta
chara
cters
e
xce
pt
for
do
llar
$,
bac
kqu
ote
s `
and
b
acks
lash
\
Ignore
s all
meta
chara
cters
betw
een t
he q
uote
s
Co
mm
and
Lin
e P
arsi
ng
$ ls $dir/*.? 2>/dev/null | tee filelist.txt
1. R
edir
ecti
on
:>
, >
>, 2>
, |
2. C
om
man
d a
nd
va
riab
le s
ub
stit
uti
on
:$va
r, $
(cm
d)
3. W
ildca
rd e
xpan
sio
n:
*, ?
, [ ]
4. C
om
man
d E
xecu
tio
n
Nex
t S
tep
...
Exe
rcis
e 8
Exe
rcis
e 8
What a
re the r
esu
lts o
f th
e follo
win
g c
om
mands?
(A
ssum
e: th
e h
om
e d
irect
ory
is
/ho
me/
joh
n, th
e c
urr
ent direct
ory
is /h
om
e/jo
hn
/do
c, a
nd it
conta
ins
files
aa, b
b
and c
c.)
$ pwd
/home/john/doc
1.$
echo "Home directory is $HOME"
__________________________________________________________
2.$
echo 'Home directory is $HOME'
__________________________________________________________
Un
it 9
: C
hec
kpo
int
ho
me
joh
n
do
c/ aa
bb
cc
3. $
echo "Current directory is `pwd`"
______________________________________________________
4. $
echo "Current directory is $(pwd)"
______________________________________________________
5. $
echo "Files in this directory are *"
______________________________________________________
6. $
echo * $HOME
______________________________________________________
7. $
echo \*
______________________________________________________
Un
it 9
: C
hec
kpo
int
(Co
nt)
Su
mm
ary
Th
e s
he
ll h
as
varia
ble
s w
hic
h d
efin
e y
ou
r e
nvi
ron
me
nt
an
d le
ts y
ou
de
fine
va
ria
ble
s o
f yo
ur
ow
n
Va
ria
ble
s ca
n b
e s
et to
a v
alu
e w
hic
h c
an
th
en
be
re
fere
nce
d a
nd
use
d w
ithin
scr
ipts
Th
e f
ollo
win
g q
uo
ting
me
tach
ara
cte
rs h
ave
be
en
d
iscu
sse
d:
Do
ub
le q
uo
te("
")
Sin
gle
qu
ote
(' ')
Ba
cksl
ash
( \
)
Pe
rfo
rm c
om
ma
nd
su
bst
itutio
n u
sin
g e
ithe
r b
ack
qu
ote
s (`
`) o
r $
(co
mm
an
d)
Un
it 1
0
Pro
cess
es
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Defin
e a
n A
IX p
roce
ss
De
scrib
e th
e r
elat
ion
ship
be
twe
en
par
ent
an
d c
hild
p
roce
sses
Cre
ate
an
d in
voke
sh
ell s
crip
ts
Wh
at is
a P
roce
ss?
Ea
ch p
rog
ram
ru
ns
in a
pro
cess
:
The v
ariable
$$
sho
ws
the
pro
cess
id o
f th
e c
urr
en
t sh
ell:
$ echo $$
4712
The p
s co
mm
and s
how
s th
e r
unnin
g p
roce
sses:
$ ps -u team01
Th
e P
roce
ss E
nvi
ron
men
t
Pro
gra
mU
ser
and
gro
up
id
Dat
a P
roce
ss id
(P
ID)
Op
en f
iles
Par
ent
Pro
cess
id (
PP
ID)
Cu
rren
t d
irec
tory
Pro
gra
m v
aria
ble
s
Lo
gin
Pro
cess
En
viro
nm
ent
log
in:
AIX
Sys
tem
PID
=20
2 -
ksh
log
in: j
oh
njo
hn
's P
ass
word
:xx
xx
xx
$ _
En
viro
nm
ent
pro
gra
m/u
sr/b
in/k
shu
idjo
hn
gid
staf
ffil
es
/dev
/tty
1P
ID20
2
Pro
cess
En
viro
nm
ent
AIX
Sys
tem
$ cat kfile
En
viro
nm
ent
du
rin
g e
xecu
tio
n
pro
gra
m/u
sr/b
in/c
atu
idjo
hn
gid
staf
ffil
es
/dev
/tty
1
kfile
pa
ren
t
-ksh
PID
310
PP
ID20
2
PID
=20
2 -
ksh
PID
=31
0 c
at
Par
ents
an
d C
hild
ren
$ echo $$
202
$ ksh
(C
reate
a s
ubsh
ell)
$ echo $$
206
$ date
(Run a
com
mand)
Tu
e
Jan 4
11
:18:2
6
GM
T 2
000
$ <ctrl-d>
(Exi
t th
e s
ubsh
ell)
$ echo $$
202
PID
PP
ID
-ksh
20
2
1
ksh
20
6
2
02
da
te 2
08
20
6
Var
iab
les
and
Pro
cess
es
$ x=4
$ ksh
$ echo $x
$ x=1
$ <ctrl-d>
$ echo $x
4
Var
iab
les
are
part
of th
e p
roce
ss e
nvi
ron
men
t.
Pro
cess
es
can
no
t ac
cess
or
chan
ge
vari
able
s fr
om
a
no
the
r p
roce
ss.
Su
bsh
ell
Act
ivit
y: E
xpo
rtin
g V
aria
ble
s
variable
Sh
ell
Su
bsh
ell
exp
ort
variable
=va
lue
Wh
at is
a S
hel
l Scr
ipt?
A s
hel
l scr
ipt
is a
co
llect
ion
of
com
man
ds
store
d in
a t
ext
file
.
$ vi hello
echo "Hello, John. Today is: $(date)"
pwd
ls
:wq
$ _
Invo
kin
g S
hel
l Scr
ipts
(1)
$ cat hello
echo "Hello, John. Today is: $(date)"
(1)
pwd
(2)
ls
(3)
$ ksh hello
Hello, John: Today is: Wed Sep 13 19:34
(1)
/home/john
(2)
books letter1 text2sarah
(3)
Su
bsh
ell
Invo
kin
g S
hel
l Scr
ipts
(2)
The s
hell
use
s th
e P
AT
H v
ariable
to fin
d e
xecu
table
pro
gra
ms.
$ cat hello
echo "Hello, John. Today is: $(date)"
(1)
pwd
(2)
ls
(3)
$ chmod +x hello
$ hello
Hello, John: Today is: Wed Sep 13 19:34
(1)
/home/john
(2)
books letter1 text2sarah
(3)
Su
bsh
ell
Invo
kin
g S
hel
l Scr
ipts
(3)
$ cat set_dir
dir1=/tmp
dir2=/usr
$ . set_dir
$ echo $dir1
/tmp
$ echo $dir2
/usr
. (d
ot)
: E
xecu
tion
in t
he
cu
rre
nt
she
ll
?W
hat is
the v
alu
e o
f dir1
and dir2
, if
set_
dir
is c
alle
d w
ithout th
e d
ot ?
Exi
t C
od
es f
rom
Co
mm
and
s
A c
om
ma
nd
re
turn
s a
n e
xit
valu
e to
th
e p
are
nt
pro
cess
:
0
=
S
ucc
ess
1
- 2
55 =
A
n e
rro
r h
as
occ
urr
ed
Th
e e
nvi
ron
me
nt va
ria
ble
$?
co
nta
ins
the
exi
t va
lue
of
the
last
co
mm
an
d:
$ cd /etc/security
ksh: /etc/security: Permission denied
$ echo $?
1
Act
ivit
y: S
hel
l Scr
ipts
Shell
Scr
ipts
Un
it 1
0: C
hec
kpo
int
1.W
hen w
ould
you e
xecu
te a
shell
script usi
ng the d
ot (.
) nota
tion?
Why?
____________________________________________________
2.W
hat is
the c
om
mand that is
use
d to c
arr
y dow
n the v
alu
e o
f a
variable
into
the s
ubsh
ell?
____________________________________________________
3.W
hat w
ould
be the v
alu
e o
f x
at th
e e
nd o
f th
e follo
win
g s
teps?
$ ( ... login shell ... )
$ ksh
$ x=50
$ export x
$ <ctrl -d>
$ ( what is the value of x set to now?)
____________________________________________________
Su
mm
ary
Sh
ell
scrip
ts c
an
be
invo
ked
in t
hre
e w
ays
:
$ k
sh sc
rip
tna
me
(mu
st h
ave
re
ad
pe
rmis
sio
n)
$ s
crip
tna
me
(mu
st h
ave
re
ad
an
d e
xecu
te p
erm
issi
on
)
$ .
scrip
tna
me
(mu
st h
ave
re
ad
pe
rmis
sio
n)
Ea
ch p
rog
ram
ru
ns
in a
n A
IX p
roce
ss
Eve
ry p
roce
ss h
as
an
en
viro
nm
en
t in
wh
ich
it r
un
s m
uch
o
f w
hic
h is
inh
erite
d fro
m it
s in
itia
ting
pro
cess
, th
e p
are
nt
pro
cess
Un
it 1
1
Co
ntr
olli
ng
Pro
cess
es
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
De
scrib
e p
roce
ss m
on
ito
rin
g
Invo
ke b
ackg
rou
nd
pro
cess
es
Term
inat
e p
roce
sses
Lis
t u
sefu
l sig
nal
s
Use
th
e n
oh
up
co
mm
an
d
Co
ntr
ol j
ob
s in
th
e K
orn
sh
ell
Mo
nit
ori
ng
Pro
cess
es
Th
e p
s co
mm
an
d d
isp
lays
pro
cess
sta
tus
info
rma
tion
$ ps -f
UID
PID
PPID ... TTY
... COMMAND
john 202 1 ... tty0 ... -ksh
john 206 202 ... tty0 ... ksh
john 210 206 ... tty0 ... ls -R /
john 212 206 ... tty0 ... ps -f
Co
ntr
olli
ng
Pro
cess
es
Fo
reg
rou
nd
Pro
cess
es:
Bac
kgro
un
d P
roce
sses
(&
):
ksh
(wait)
ls -
R
$ ls -R / > bigfile
$ _
ksh
ls -
R
$ ls -R / > bigfile &
$ _
Term
inat
ing
Pro
cess
es
Fo
reg
rou
nd
Pro
cess
es:
crtl
-cIn
terr
up
t ke
y, c
an
cels
a fo
reg
rou
nd
p
roce
ss.
kill
So
me
time
s th
e k
ill c
om
ma
nd
is u
sed
to
te
rmin
ate
fo
reg
rou
nd
pro
cess
es.
Bac
kgro
un
d P
roce
sses
:
kill
The k
ill c
om
mand is
the o
nly
way
tote
rmin
ate
ba
ckg
rou
nd
pro
cess
es.
Term
inat
ing
Pro
cess
es (
Co
nt)
The k
ill c
om
mand s
ends
a s
ignal t
o a
runnin
g p
roce
ss, w
hic
h
norm
ally
sto
ps
the p
roce
ss.
$ ps -f
UID PID PPID ... TTY ... COMMAND
john 202 1 ... tty0 ... -ksh
john 204 202 ... tty0 ... db2_start
john 206
202 ... tty0 ... find /
$ kill 204
(Te
rmin
atio
n S
ign
al)
$ kill -9 206
(Kill
Sig
na
l)
Term
ina
tio
n:
No
tific
atio
n to
th
e p
rog
ram
to
te
rmin
ate
Kill
:K
ill th
e a
pp
lica
tion
wit
ho
ut
no
tifi
cati
on
(U
se w
ith
care
!)
Sig
nal
s
Sig
nal
Mea
nin
g
01
ha
ng
up
- y
ou
log
ge
d o
ut
wh
ile t
he
pro
cess
wa
s st
ill r
un
nin
g
02
inte
rru
pt
- yo
u p
ress
ed
th
e in
terr
up
t (b
rea
k) k
ey
seq
ue
nce
ctr
l-c
03
qu
it -
you
pre
sse
d t
he
qu
it ke
y se
qu
en
ce c
trl-
\
09
Kill
sig
na
l:
Th
e m
ost
po
we
rfu
l (a
nd
ris
ky)
sig
na
l th
at
can
be
se
nt:
S
ign
al c
an
no
t b
e a
void
ed
or
ign
ore
d!
15
Term
ina
tion
sig
na
l (D
efa
ult)
: S
top
a p
roce
ss
Sig
na
l ca
n b
e h
an
dle
d b
y p
rog
ram
s.
Ru
nn
ing
Lo
ng
Pro
cess
es
Th
e n
oh
up
co
mm
an
d w
ill p
reve
nt a
pro
cess
fro
m b
ein
g
kille
d if
yo
u lo
g o
ff th
e s
yste
m b
efo
re it
co
mp
lete
s:
$ nohup ls -R / > out &
[1]
59
$ _
If y
ou
do
no
t re
dire
ct o
utp
ut,
no
hu
p w
ill r
ed
ire
ct o
utp
ut to
a
file
no
hu
p.o
ut:
$ nohup ls -R / &
[1]
61
Sending output to nohup.out
$ _
Job
Co
ntr
ol i
n t
he
Ko
rn S
hel
l
job
sLis
ts a
ll jo
bs
<ct
rl-z
>
Susp
end fore
gro
und task
fg %
jobnum
ber
Exe
cute
job in
fore
gro
und
bg
%jo
bnum
ber
Exe
cute
job in
back
gro
und
Job
Co
ntr
ol E
xam
ple
$ ls -R / > out 2> errfile &
[1]
273
$ jobs
[1] +
Running ls -R / > out 2> errfile &
$ _
$ fg %1
ls -R / > out 2> errfile
<ctrl-z>
[1] + Stopped (SIGTSTP) ls -R / > out 2> errfile &
$ _
$ bg %1
$ jobs
[1]
+ Running ls -R / > out 2> errfile &
$ _
$ kill %1
[1]
+ Terminate ls -R / > out 2> errfile &
$ _
Sta
rt jo
b
Lis
ts jo
bs
Fo
reg
rou
nd
Su
spe
nd
Ba
ckg
rou
nd
Term
inate
Dae
mo
ns
A d
aem
on
is a
ne
ver-
en
din
g p
roce
ss, th
at co
ntr
ols
a
syst
em
re
sou
rce
su
ch a
s th
e p
rin
ter
qu
eu
e.
printe
r
qdaem
on
Queue
file
1
file
2
.
.
Nex
t S
tep
...
Exe
rcis
e 9
Un
it 1
1: C
hec
kpo
int
1.W
ha
t o
ptio
n w
ou
ld y
ou
use
with
th
e p
s co
mm
an
d t
o s
ho
w t
he
d
eta
iled
co
mm
an
ds
tha
t yo
u a
re r
un
nin
g?
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
_
2.T
rue
or
fals
e?
As
an
ord
ina
ry u
ser
you
ca
n o
nly
kill
yo
ur
ow
n
job
s a
nd
no
t th
ose
of
oth
er
use
rs.
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
_
3.W
hic
h is
th
e s
tro
ng
est
sig
na
l th
at
can
be
se
nt
to a
pro
cess
to
te
rmin
ate
it?
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
_
4.I
t is
alw
ays
se
nsi
ble
to
sta
rt lo
ng
job
s in
th
e b
ack
gro
un
d w
ith t
he
n
oh
up
co
mm
an
d.
Wh
y is
th
is?
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
_
5.W
ha
t is
th
e n
am
e f
or
spe
cia
l ne
ver-
en
din
g s
yste
m p
roce
sse
s in
th
e U
NIX
en
viro
nm
en
t?_
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
Su
mm
ary
To m
onito
r pro
cess
es
use
the p
s co
mm
an
d
Ba
ckg
rou
nd
pro
cess
es
are
invo
ked
by
incl
ud
ing
an
am
pe
rsa
nd
&
at
the
en
d o
f th
e c
om
ma
nd
Use
th
e k
ill c
om
ma
nd
to
te
rmin
ate
pro
cess
es
So
me
use
ful s
ign
als
th
at te
rmin
ate
pro
cess
es
are
kill
-2,
kill
-3
and k
ill
-9
Jobs
can b
e c
ontr
olle
d in
the K
orn
shell
by
susp
endin
g a
job w
ith
<ct
rl z
> a
nd
re
sta
rte
d u
sin
g t
he
bg
or
fg c
om
ma
nd
s
Th
e n
oh
up
co
mm
an
d a
llow
s yo
u t
o s
tart
a jo
b in
th
e b
ack
gro
un
d
an
d c
om
ple
te p
roce
ssin
g a
fte
r yo
u lo
g o
ff
Sys
tem
pro
cess
es
are
ca
lled
da
em
on
s.
Th
ey
are
oft
en
use
d t
o
con
tro
l sys
tem
re
sou
rce
s lik
e t
he
prin
ter
qu
eu
ein
g m
ech
an
ism
Un
it 1
2
Cu
sto
miz
ing
th
eU
ser
En
viro
nm
ent
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
De
scrib
e th
e p
urp
ose
of th
e lo
gin
pro
file
Ch
an
ge
th
e P
AT
H a
nd
PS
1 v
aria
ble
s
Use
th
e s
he
ll h
isto
ry m
ech
an
ism
Set
alia
se
s fo
r co
mm
on
ly u
sed
co
mm
an
ds
Lo
gin
File
s
login: team01
team01's Password:
$ _
/etc
/en
viro
nm
en
t
/etc
/pro
file
$H
OM
E/.
pro
file
root
root
Use
r
Sam
ple
/et
c/en
viro
nm
ent
$ cat /etc/environment
# WARNING:This file is only for establishing environment
# variables. Execution of commands from this file or any
# lines other than specified above may cause failure of the
# initialization process.
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin
TZ=EST5EDT
LANG=C
LOCPATH=/usr/lib/nls/loc
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
Sam
ple
/et
c/p
rofi
le$ cat /etc/profile
# System-wide profile. All variables set here may be
# overridden by a user's personal .profile file in their
# $HOME directory. However all commands here will be
# executed at login regardless.
readonly LOGNAME
umask 022
# Automatic logout (after 120 seconds inactive)
TMOUT=120
# The MAILMSG will be printed by the shell every
# MAILCHECK seconds (default 600) if there is mail in the
# MAIL system mailbox.
MAIL=/usr/spool/mail/$LOGNAME
MAILMSG="[YOU HAVE NEW MAIL]"
# Ensure that the TERM variable is set up correctly
TERM=ibm3151
export LOGNAME MAIL MAILMSG TERM TMOUT
En
viro
nm
ent
Var
iab
les
(1)
LO
GN
AM
ET
his
ho
lds
you
r lo
gin
na
me
. It
is r
ea
d b
y m
an
y co
mm
an
ds.
Va
lue
ca
nn
ot b
e c
ha
ng
ed
(re
ad
on
ly v
aria
ble
).
TM
OU
TH
old
s th
e v
alu
e f
or
ho
w lo
ng
a t
erm
ina
l ca
n b
e in
act
ive
be
fore
th
e
term
ina
l is
log
ge
d o
ff b
y th
e s
yste
m.
MA
ILH
old
s th
e n
am
e o
f th
e f
ile w
he
re y
ou
r m
ail
is s
en
t.
TE
RM
Th
e te
rmin
al t
ype
yo
u a
re u
sin
g. U
sed
by
scre
en
-orie
nte
d a
pp
lica
tion
s lik
e v
i or
sm
it.
Sam
ple
.p
rofi
le
$ cat .profile
PATH=/bin:/usr/bin:/etc:$HOME/bin:.
PS1=' $PWD=> '
if[
-s "$MAIL"
]then
echo
"$MAILMSG"
fi
ENV="$HOME/.kshrc"
export PATH PS1 ENV
Exe
cute
th
is file
eve
ry tim
e a
n
ew
Korn
she
ll is
sta
rte
d.
En
viro
nm
ent
Var
iab
les
(2)
PA
TH
A li
st o
f co
lon
-se
pa
rate
d d
ire
cto
rie
s th
at
the
sh
ell
sea
rch
es
for
com
ma
nd
s:PATH=/bin:/usr/bin:/etc:$HOME/bin:.
PS
1P
rim
ary
sys
tem
pro
mp
t (d
efa
ult=
$).
To
sh
ow
th
e h
ost
na
me
an
d th
e
curr
en
t d
ire
cto
ry in
th
e p
rom
pt:
PS1="$(hostname), "'$PWD: '
EN
VP
oin
ter
to a
file
co
nta
inin
g K
orn
sh
ell
sett
ing
s:ENV="$HOME/.kshrc"
Sam
ple
.ks
hrc
$ cat .kshrc
# set up the command recall facility
set -o vi
# set up a few aliases
alias l='ls-l'
alias p='ps-f'
alias up='cd
..'
ksh
Fea
ture
s -
Alia
ses
$alias p='ps -ef'
$alias l='ls -l'
$alias
history='fc -l'
l='ls -l'
p='ps
-ef'
r='fc
-e-'
Sh
ow
all
alia
s d
efin
itio
ns
ksh
Fea
ture
s -
Usi
ng
Alia
ses
$ l
-rw-r--r--1
joe
staff
524
Sep 19
11:31
fleas
-rw-r--r--1
joe
staff
1455
Jan 23
17:18
walrus
$ unalias
l
$l
ksh:
l:not found
alia
s l=
ls -
l
Re
mo
ve a
lias
de
finiti
on
ksh
Fea
ture
s -
His
tory
Last
128 c
om
mands
are
sto
red in
file
$H
OM
E/.s
h_h
isto
ry
$fc -l
2cd /home/payroll
3ls -l
4mail
5fc -l
$ r m
No mail for team01
$ r 3
-rw-r--r--1
joe
staff
524
Sep 19
11:31
fleas
-rw-r--r--1
joe
staff
1455
Jan 23
17:18
walrus
$ h
isto
ry
Nex
t S
tep
...
Exe
rcis
e 10
W
hic
h file
wo
uld
yo
u u
se to
cu
sto
miz
e y
ou
r u
ser
e
nvi
ron
me
nt?
Wh
y?
_
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
W
ha
t d
o th
e fo
llow
ing
va
ria
ble
s d
efin
e o
n y
ou
r sy
ste
m?
PS
1:
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
_
TE
RM
:_
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
PA
TH
:_
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
Un
it 1
2: C
hec
kpo
int
Su
mm
ary
Th
e p
urp
ose
of th
e lo
gin
pro
file
wa
s co
nsi
de
red
in
con
jun
ctio
n w
ith th
e c
ust
om
iza
tion
file
s /e
tc/p
rofi
le,
/etc
/en
viro
nm
ent,
$H
OM
E/.p
rofi
le a
nd $
HO
ME
/.ksh
rc
Th
e s
he
ll h
isto
ry m
ech
an
ism
is o
ne
me
tho
d th
at ca
n b
e
use
d to
re
call
pre
vio
us
com
ma
nd
s
Alia
ses
can
be
se
t u
p to
pro
vid
e a
n a
ltern
ate
na
me
fo
r co
mm
an
ds
Un
it 1
3
AIX
Uti
litie
s
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Use
the f
ind
com
mand to s
earc
h d
irect
ories
for
files
with
part
icula
r ch
ara
cterist
ics
Use
the g
rep
com
mand t
o s
earc
h t
ext
file
s fo
r pattern
s
Use
the h
ead
and t
ail c
om
mands
to v
iew
speci
fic li
nes
in a
fil
e
Use
the s
ort
com
mand t
o m
anip
ula
te t
he c
onte
nts
of
the
files
Use
the d
osr
ead
, do
swri
te, d
osd
el, and
do
sfo
rmat
co
mm
ands
to m
anip
ula
te f
iles
from
a P
C-D
OS
envi
ronm
ent
Use
the t
n a
nd f
tp c
om
mands
to c
om
munic
ate
with
oth
er
host
s
fin
d
Sea
rch
on
e o
r m
ore
dire
cto
ry s
tru
ctu
res
for
file
s th
at
mee
t ce
rtai
n s
pec
ifie
d c
rite
ria
Dis
pla
y th
e n
ames
of m
atc
hin
g file
s o
r ex
ecu
te
com
man
ds
ag
ain
st th
ose
file
s
find path expression
Sam
ple
Dir
ecto
ry S
tru
ctu
re
fleas
misc
phone1
phone2
child
large
medium
small
sync
size
blue
brown
green
sum
white
yellow
color
misc
oval
round
sphere
sum
sync
shape
joe
home
/
Usi
ng
fin
d
Se
arc
h a
dire
cto
ry s
tru
ctu
re f
or
file
s w
ith c
ert
ain
na
me
s:
$ find . -name sum
./color/sum
./shape/sum
On
ma
ny
UN
IX s
yste
ms,
yo
u m
ust
use
-p
rin
t:
$ find . -name sum -print
./color/sum
./shape/sum
T
he
exe
c o
ptio
n e
xecu
tes
a c
om
ma
nd o
n e
ach
of
the f
iles
found
$ find . -name 'm*' -exec ls -l {} \;
-rw-r--r-- 1 joe staff 83 Jan 11 15:55 ./shape/misc
-rw-r--r-- 1 joe staff 21 Jan 11 16:01 ./size/medium
-rw-r--r-- 1 joe staff 38 Jan 11 15:34 ./misc
Exe
cuti
ng
Co
mm
and
s w
ith
fin
d
Ma
tch
ed
fil
e n
am
e
Inte
ract
ive
Co
mm
and
Exe
cuti
on
The o
k optio
n c
ause
s co
mm
and
exe
cuti
on
on a
n i
nte
ract
ive
ba
sis
$ find . -name m\* -ok rm {} \;
<rm ... ./shape/misc>? y
<rm ... ./size/medium>? y
<rm ... ./misc >? n
Ad
dit
ion
al O
pti
on
s
-typ
e f
ord
inary
file
ddirect
ory
-siz
e
+n
larg
er
than "
n"
blo
cks
-n
smalle
r th
an "
n"
blo
cks
n
equal t
o "
n"
blo
cks
-mti
me
+
x
modifi
ed m
ore
than "
x" d
ays
ago
-x
modifi
ed le
ss than "
x" d
ays
ago
-per
m
onum
acc
ess
perm
issi
ons
matc
h "
onum
"
mode
acc
ess
perm
issi
ons
matc
h "
mode"
valu
es
(ex.
rw
x)
-use
r
use
r
finds
files
ow
ned b
y "u
ser"
-o
logic
al "
or"
-new
er
ref.fil
ese
arc
hes
for
files
that are
new
er
than the r
efe
rence
fil
e. (y
ou s
peci
fy the r
efe
rence
file
)
fin
d E
xam
ple
s
$ find . -name 's*' -type f -size +2 -exec ls -l {} \;
-rwxr-xr-x 1 joe staff 1512 Jan 11 15:43 ./color/sum
-rwxr-xr-x 1 joe staff 2148 Jan 11 15:57 ./shape/sum
$ find . -perm 644 -mtime +4 -print
./shape/misc
$ find . -name fleas -o -name misc
./misc
./shape/misc
./fleas
$ find / -name 'security' -print 2> errfile
/var/security
/usr/lpp/bos.sysmgt/inst_root/var/security
/usr/lib/security
/etc/security
Nex
t S
tep
...
Exe
rcis
e 11
gre
p
Sea
rch
fo
r lin
es
ma
tch
ing
sp
eci
fied
pat
tern
grep [options] pattern [file1 file2 ...]
Sim
ple
te
xtR
eg
ula
r e
xpre
ssio
n
gre
p S
amp
le D
ata
File
s
ph
on
e1:
As of: 1/31/2000
Anatole 389-8200
Avis Betty 817 422-8345
Baker John 656-4333
Computer Room CE phone 689-5790
Dade Travel Sue 422-5690
Hotline HW 800 322-4500
ph
on
e2:
As of: 2/15/2000
Anatole 389-8200
Avis Betty 817 422-8345
Baker John 656-4333
Computer Room CE phone 592-5712
Dade Travel Sue 422-5690
Hotline HW 800 322-4500
Bas
ic g
rep
$ grep 800 phone1
Hotline HW 800 322-4500
$ grep 800 phone*
phone1:Hotline HW 800 322-4500
phone2:Hotline HW 800 322-4500
gre
p w
ith
Reg
ula
r E
xpre
ssio
ns
grep 'regular_expression' file
Valid
meta
chara
cters
:
.
An
y si
ng
le c
har
acte
r
*
Zer
o o
r m
ore
occ
urr
ence
s of
the p
rece
din
g c
har
acte
r
[aA
] E
num
era
tion:
a o
r A
[a-f
] A
ny
ON
E o
f th
e c
hara
cters
in the r
ang
e o
f a
thro
ug
h f
^a
An
y lin
es
tha
t sta
rt w
ith a
z$
A
ny
line
s th
at e
nd
with
a z
gre
p E
xam
ple
s
$ ps -ef | grep team01
team01 10524 13126 0 09:27:45 pts/1 0:00 -ksh
$ grep '^B' phone1
Baker John 656-4333
$ grep '5$' phone1
Avis Betty 817 422-8345
$ grep '^[DH]' phone1
Dade Travel Sue 422-5690
Hotline HW 800 322-4500
$ grep '^A.*0$' phone1
As of: 1/31/2000
Anatole 389-8200
^: S
tart
$: E
nd
[DH
]: E
nu
me
ratio
n
.*: Z
ero
or
more
occ
urr
ence
s of any
sing
le c
hara
cter
gre
p O
pti
on
s
-v
print lin
es
that d
o n
ot
mat
ch
-c
only
a c
ou
nt
of
matc
hin
g li
nes
-l
p
rin
t o
nly
th
e n
ames
of th
e file
s w
ith m
atc
hin
g li
nes
-n
n
um
ber
the m
atc
hin
g li
nes
-i
ig
no
re t
he
case
of
letters
when m
aki
ng c
om
pariso
ns
-w
d
o a
wh
ole
wo
rd s
ea
rch
Oth
er g
rep
s
fgre
p
$ fgrep 'HW' phone1
Hotline HW 800 322-4500
egre
p
$ egrep '800|817' phone1
Avis Betty 817 422-8345
Hotline HW 800 322-4500
fast
gre
p: O
nly
fix
ed
str
ing
s, n
o r
eg
ula
r e
xpre
ssio
ns
Ext
ended g
rep:
Allo
ws
for
multi
ple
pattern
s
Act
ivit
y: g
rep
Co
mm
and
gre
p ?
??
sort
Co
mm
and
Th
e s
ort
co
mm
an
d s
ort
s lin
es
an
d w
rite
s th
e r
esu
lt to
st
an
da
rd o
utp
ut:
$ sort [-t delimiter][+field[.column]][options]
Op
tion
s:
-d so
rts
in d
ictio
na
ry o
rde
r. O
nly
lett
ers
, d
igits
a
nd
sp
ace
s a
re c
on
sid
ere
d in
co
mp
ariso
ns.
-r re
vers
es
the
ord
er
of th
e s
pe
cifie
d s
ort
-n so
rts
nu
me
ric
field
s in
arith
me
tic v
alu
e
sort
Exa
mp
les
$ cat animals
dog.2
cat.4
elephant.10
rabbit.7
$ sort animals
cat.4
dog.2
elephant.10
rabbit.7
$ cat animals | sort +0.1
rabbit.7
cat.4
elephant.10
dog.2
$ cat animals | sort -t. -n +1
dog.2
cat.4
rabbit.7
elephant.10
Defa
ult
sort
ord
er
So
rt b
y se
con
d c
ha
ract
er
-t
: D
elim
iter
"."
-n
: N
um
erica
l ord
er
+
1: S
eco
nd
fie
ld
hea
d a
nd
tai
l co
mm
and
s
Th
e h
ead
com
ma
nd
ca
n b
e u
sed
to
vie
w t
he
fir
st f
ew li
nes
of
a f
ile o
r fil
es.
head [-number_of_lines] file(s)
$ head -5 myfile
$ ls -l | head -12
The
tai
l co
mm
an
d w
rite
s a
file
to
sta
nd
ard
ou
tpu
t, b
egin
nin
g a
t a
spec
ifie
d
po
int.
tail [-number_of_lines | +starting_line_number] file(s)
$ tail -20 file
$ tail +20 file
Tra
nsf
erri
ng
DO
S D
ata
File
s
$ dosdir -l
Lis
t th
e c
on
ten
ts o
f a
DO
S d
iske
tte
$ dosread file1.doc file1
Co
py
a fi
le f
rom
dis
kett
e t
o A
IX
$ doswrite file1 file1.doc
Co
py
a fi
le f
rom
AIX
to
a D
OS
dis
kett
e
$ dosread -a letter.txt letter
$ doswrite -a letter letter.txt
Co
nve
rt a
n A
IX t
ext
file
to
DO
S f
orm
at
or
a D
OS
te
xt f
ile t
o A
IX f
orm
at
$ dosdelete filez
Del
ete
a f
ile f
rom
a D
OS
dis
kett
e
tn:
Lo
gin
to
Rem
ote
Ho
sts
Use
the t
n-c
om
mand t
o lo
gin
to r
em
ote
host
s
Exa
mp
le:
$ tn miami
Trying ...
Connected to miami
...
AIX Version 5
(C) Copyright by IBM and others 1982, 1996
login: team01
ftp
: T
ran
sfer
File
s B
etw
een
Ho
sts
Use
th
e f
tp-c
om
mand t
o t
ransf
er
files
betw
een h
ost
s
Exa
mple
:
$ ftp miami
Connected to miami
220 FTP server ready
Name (miami: team01):team05
Password required for team05.
Password:
230 User team05 logged in.
ftp>
ftp
-Pro
mp
t w
aiti
ng
fo
r su
bco
mm
an
ds
ftp>
pwd
ftp>
cd RemoteDir
ftp>
dir
(or)
ls -l
ftp>
get RemoteFile [LocalFile]
ftp>
put LocalFile[RemoteFile]
ftp>
help [subcommand]
ftp>
quit
The m
ost
import
ant
ftp
su
bco
mm
an
ds
are
:
ftp
Su
bco
mm
and
s
tar
(ta
pe
arc
hiv
er)
sa
ves
file
s re
curs
ivel
y a
nd
sto
res
the
m
as
on
e ar
chiv
e fi
le.
A XI
tar -cvf /dev/rmt0 .
tar -cvf /dev/fd0 .
tar -cvf /tmp/file.tar .
A XI
tar -xvf /dev/rmt0
tar -xvf /dev/fd0
tar -cvf /tmp/file.tar .
tar -xvf /tmp/file.tar
To s
how
the c
onte
nt
of
the a
rchiv
e f
ile:
tar -tvf /dev/rmt0 (or /dev/fd0)
tar:
Bac
kup
an
d R
esto
re F
iles
Nex
t S
tep
...
Exe
rcis
e 1
2
Un
it 1
3: C
hec
kpo
int
1.W
hic
h c
om
mand(s
) w
ould
you u
se to lo
cate
all
the file
s in
your
syst
em
that began w
ith the s
trin
g "
smit"
? _
___________________________________________________
2.W
hat is
the follo
win
g c
om
mand d
oin
g?
$ ps -ef | grep -w root | grep -w netscape
____________________________________________________
____________________________________________________
3.I
ndic
ate
what th
e follo
win
g c
om
mand is
doin
g:
$ ls -l /home | egrep 'txt$ | team01$' | sort -r +7 | tail +4 | head -5
____________________________________________________
____________________________________________________
____________________________________________________
____________________________________________________
Su
mm
ary
Th
e fo
llow
ing
co
mm
an
ds
we
re c
on
sid
ere
d:
Th
e f
ind
co
mm
an
d is
use
d to
re
curs
ive
ly s
ea
rch
d
ire
cto
rie
s fo
r fil
es
with
pa
rtic
ula
r ch
ara
cte
rist
ics
Th
e g
rep
co
mm
an
d is
use
d t
o s
ele
ct e
ntir
e li
ne
s co
nta
inin
g a
pa
rtic
ula
r p
att
ern
Th
e h
ead
an
d t
ail c
om
ma
nd
s a
re u
sed
to
vie
w s
pe
cific
lin
es
in a
file
Th
e s
ort
co
mm
an
d s
ort
s th
e c
on
ten
ts o
f th
e f
ile b
y th
e
op
tion
s sp
eci
fied
File
s fr
om
a D
OS
en
viro
nm
en
t ca
n b
e m
an
ipu
late
d in
AIX
u
sin
g th
e fo
llow
ing
co
mm
an
ds:
do
srea
d, d
osw
rite
and
do
sdel
Un
it 1
4
AIX
Uti
litie
s P
art
II
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Use
th
e x
arg
s co
mm
an
d
Use
th
e -
links
op
tion
with
fin
d
Use
wh
ich
, w
her
eis
an
d w
hen
ce c
om
ma
nd
s
De
term
ine
th
e t
ype
of
a fi
le u
sin
g t
he
file
co
mm
an
d
Use
dif
f, c
mp
and d
ircm
p to
co
mp
are
file
s a
nd
d
ire
cto
rie
s
Co
mp
ress
file
s to
sa
ve s
pa
ce
Dis
pla
y n
on
-pri
nta
ble
ch
ara
cte
rs in
file
s a
nd
dire
cto
rie
s
xarg
s
Re
ad
s a
gro
up
of
arg
um
ents
fro
m s
tdin
, ru
ns
an A
IX
com
ma
nd
with
th
at g
rou
p o
f a
rgu
me
nts
:
$ cat oldfilelist
file1
file2
file3
file4
$ cat oldfilelist | xargs -t rm
rm file1 file2 file3 file4
file1 file2 file3 file4
xarg
s E
xam
ple
s
$ ls > printlist
$ vi printlist
file1
file2
file3
...
file10
$ xargs -t qprt < printlist
qprt file1 file2 file3 file4 file5 ... file10
$ ls | xargs -t -I {} mv {} {}.old
mv apple apple.old
mv banana banana.old
mv carrot carrot.old
xarg
s, f
ind
, gre
p
$ find . -type f -mtime +30 | xargs -t rm
rm ./file1 ./file2 ./file3 ./file4
$ find . -type f | xargs -t grep -l Hello
grep -l Hello ./file5 ./file7 ./file10
./file7
Sce
na
rio
: S
tart
ing
at cu
rre
nt d
ire
cto
ry fin
d a
ll fil
es
tha
t st
art
w
ith c
$ ls c*
c1 c2
$ find . -name 'c*'
./c1
./c2
./dir1/c3
./dir1/c4
./dir1/dir2/c5
./dir1/dir2/c6
Th
e S
hel
l ver
sus
fin
d
/
hom
e
tea
m0
1 dir1 d
ir2
c1
c2
c3
c4
c5
c6
Sh
ell
exp
an
ds
wild
card
find e
xpands
wild
card
Th
e -l
inks
Op
tio
n w
ith
fin
d
$ find /home -type f -links +1 | xargs ls -li
Sam
e i-
no
des
Nu
mb
er o
f lin
ksS
ame
nu
mb
er o
f b
ytes
127
127
127
-rw
-r--
r--
-rw
-r--
r--
-rw
-r--
r--
3 3 3
team
01
team
01
team
01
sta
ffst
aff
sta
ff
15
61
56
15
6
July
26 1
3:1
1 /hom
e/team
01/m
yfile
July
26 1
3:1
1 /hom
e/team
01/y
ourf
ileJu
ly 2
6 1
3:1
1 /h
om
e/t
ea
m0
2/a
kafil
e
alia
s an
d f
ind
$ cat $HOME/.kshrc
alias mylinks='find . -type f -links +1 | xargs ls -li'
alias myrm='find . -type f -mtime +30 | xargs rm'
$ mylinks
127 -rw-r--r-- 3 team01 staff ... /home/team01/myfile
127 -rw-r--r-- 3 team01 staff ... /home/team01/yourfile
127 -rw-r--r-- 3 team01 staff ... /home/team02/akafile
$ myrm
ENV=$HOME/.kshrc
wh
ich
, wh
erei
s, w
hen
ce
$ which find grep
/usr/bin/find
/usr/bin/grep
$ whereis find grep
find: /usr/bin/find
grep: /usr/bin/grep
$ whence find grep
/usr/bin/find
/usr/bin/grep
file $ file /usr/bin/vi
/usr/bin/vi:executable (RISC System/6000) or object module
$ file c1
c1: ascii text
$ file /usr/bin
/usr/bin: directory
$ ls > filenames
$ cat filenames
c1
dir1
$ file -f filenames
c1: ascii text
dir1: directory
Nex
t S
tep
...
Exerc
ise 13
dif
f (D
iffe
ren
tial
File
Co
mp
arat
or)
An
aly
zes
text
file
s
Re
po
rts
the
dif
fere
nce
s b
etw
ee
n file
s
diff [-options] file1 file2
Co
mp
arin
g T
wo
File
s U
sin
g d
iff
$ diff names names.old
1c1
< Carol
----
> Caroline
4d3
< Don
5a5
> Sam
Car
ol
Bo
bJi
mD
on
Ma
ry
Car
olin
eB
ob
Jim
Ma
ryS
am
na
me
s: (
<)
nam
es.
old
: (
>)
Co
mp
arin
g T
wo
File
s U
sin
g c
mp
$ cmp names names.old
names names.old differ: byte 6, line 1
$ cmp -l names names.old
6 12 151
7 102 156
8 157 145
...
...
...
cmp: EOF on names
Co
mp
arin
g D
irec
tori
es U
sin
g d
ircm
p$ dircmp -d /home/team01 /home/team02
Fri Jan 21 10:31:10 CDT 2000 /home/team01 only and /home/team02 only
./dir1 ./b1
./dir1/c3
./dir1/c4
./dir1/dir2
./dir1/dir2/c5
./dir1/dir2/c6
Fri Jan 21 10:31:10 CDT 2000 Comparison of /home/team01 and /home/team02
directory .
same ./.profile
different ./.sh_history
different ./c1
same ./c2
Fri Jan 21 10:31:10 CDT 2000 diff of ./c1 in /home/team01 and /home/team02
1c1
< Now is the time for all good men
---
> Now is the time for all good women
1: L
ist fil
es
un
iqu
e to
each
direct
ory
2: L
ist fil
es
with
id
enti
cal n
am
es
3: D
ispla
y d
iffe
ren
ces
for
com
mo
n f
iles
/ho
me/
team
01
.pro
file
.sh
_h
isto
ryc1 c2
c3 c4
c5 c6
dir1
dir2
/ho
me/
team
02
.pro
file
.sh
_h
isto
ryb
1c1 c2
Sam
ple
Direct
ory
Str
uct
ure
:
com
pre
ss, u
nco
mp
ress
, zca
t
$ ls -l file1
-rw-r--r-- 1 team01 staff 13383 July 26 10:10 file1
$ compress -v file1
file1: Compression 56.99% file1 is replaced with file1.Z
$ ls -l file1.Z
-rw-r--r-- 1 team01 staff 5756 July 26 10:10 file1.Z
$ zcat file1.Z
(output is the normal output of the uncompressed file)
$ uncompress file1.Z
$ ls -l file1
-rw-r--r-- 1 team01 staff 13383 July 26 10:10 file1
Dis
pla
yin
g N
on
-Pri
nta
ble
Ch
arac
ters
in F
iles
$ cat myfile
This
file
has
tabs
and spaces and ends with
a return
$ cat -vte myfile
This^Ifile^G has tabs^Iand spaces and^Iends with a^Ireturn$
-v:
Display non-printing characters as visible characters
-t:
Display tab characters as ^I
-e:
Display a $ at the end of each line
$ ls
greatfile myfile
$ rm greatfile
No such file
$ ls | cat -vt
^Ggreatfile
myfile
1. rm ^Ggreatfile
2. mv ^Ggreatfile greatfile
3. ls -i
130 ^Ggreatfile 127 myfile
find . -inum 130 -exec rm {} \;
No
n-P
rin
tab
le C
har
acte
rs in
Dir
ecto
ries
To
fix
th
is f
ile, u
se o
ne
of
thes
eth
ree
met
ho
ds
!
Ass
ign
ing
Un
iqu
e F
ile N
ames
$ touch myfile$$
$ ls
myfile1288
$ date
Mon Feb 14 07:20:15 CDT 2001
$ date + '%m%d%H%M%S'
0214072015
$ touch myfile.$(date +'%m%d')
$ ls
myfile.0214
Append t
he p
roce
ss I
D:
$$
Append t
he d
ate
usi
ng a
co
mm
and s
ubst
itutio
n
Nex
t S
tep
...
Exerc
ise 14
Un
it 1
4: C
hec
kpo
int
1.T
rue o
r fa
lse? f
ind
's m
ost
import
ant ch
ara
cterist
ic is
its
abili
ty to tra
vel
up t
hro
ugh t
he f
ile t
ree h
iera
rchy.
2.T
rue o
r fa
lse? W
hen q
uote
d m
eta
chara
cters
are
use
d w
ith f
ind
, th
e
shell
will
first
exp
and the w
ildca
rd then p
ass
contr
ol t
o f
ind
.
3.W
hic
h c
om
mand is
use
d to d
ete
rmin
e the typ
e o
f data
in a
file
? a
) cm
p b
) diff
c)
file
d)
dirc
mp
4.T
rue o
r fa
lse? d
iff
com
pare
s te
xt file
s only
.
5.T
rue o
r fa
lse? T
he c
om
pre
ss c
om
mand w
ill d
ele
te the file
it is
co
mpre
ssin
g a
nd r
epla
ce it
with
the c
om
pre
ssed file
als
o r
enam
ing it
w
ith a
.z e
xtensi
on.
6.T
o d
ispla
y non-p
rinta
ble
chara
cters
in a
file
or
direct
ory
, use
:a
) ls
-li
b)
cat -v
tec)
diff
-c
d)
cmp
xarg
s r
eads
arg
um
ents
one li
ne a
t a tim
e fro
m S
/I a
nd
ass
em
ble
s as
many
of th
em
as
will
fit
into
one c
om
mand li
ne
-lin
ks s
earc
hes
for
the n
um
ber
of lin
ks in
file
s or
direct
ories
wh
ich
, wh
erei
s and w
hen
ce a
re u
sed to lo
cate
pro
gra
ms
dif
f co
mpare
s th
e c
onte
nts
of tw
o text
file
s
cmp
com
pare
s th
e c
onte
nts
of tw
o file
s of all
file typ
es
dir
cmp
is u
sed to c
om
pare
the c
onte
nts
of tw
o d
irect
ories
com
pre
ss c
om
pre
sses
data
in file
s usi
ng L
em
pel-Z
ev
codin
g
cat
-vte
will
dis
pla
y non-p
rinta
ble
chara
cters
in a
file
or
direct
ory
Su
mm
ary
Un
it 1
5
Ad
dit
ion
al
Sh
ell
Fea
ture
s
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Pa
ss p
osi
tio
nal
par
amet
ers
to s
hell
scripts
Use
th
e t
est
com
ma
nd
Use
th
e if
sta
tem
ent
Imp
lem
en
t in
tera
ctiv
e sh
ell s
crip
ts
Imp
lem
en
t lo
op
s w
ithin
scr
ipts
Imp
ort
ant
Sh
ell V
aria
ble
s
$$P
roce
ss I
D (
PID
)
$0S
he
ll sc
rip
t n
am
e
$#N
um
ber
of arg
um
ents
pass
ed to the s
hell
script
$*A
ll co
mm
and li
ne a
rgum
ents
pass
ed t
o t
he s
crip
t
$?E
xit
valu
e o
f th
e la
st c
om
ma
nd
$!
Pro
cess
ID
of la
st b
ack
gro
un
d p
roce
ss
Po
siti
on
al P
aram
eter
s
Par
am
eter
s ca
n b
e p
ass
ed to s
hell
scripts
as
arg
um
ents
on
th
e c
om
mand li
ne:
$1, $2, ... $9
${10}, ${11}, ... ${n}
(Korn Shell only)
$ cat ascript
echo First Parameter entered was $1
echo Second Parameter entered was $2
echo Third Parameter entered was $3
$ ascript Good Day Sydney
First Parameter entered was Good
Second Parameter entered was Day
Third Parameter entered was Sydney
$0
$1
$2
$3
Th
e ex
pr
Uti
lity
Use
the e
xpr
util
ity t
o p
erf
orm
inte
ger
arith
metic
exp
r o
ffe
rs th
e fo
llow
ing
op
erat
ors
:
\* multiplication
/ integer division
% remainder
+ addition
- subtraction (also unary minus sign)
hig
h
low
Precedence:
exp
r E
xam
ple
s
$ var1=6
$ var2=3
$ expr $var1 / $var2
2 $ expr $var1 - $var2
3 =>
Use
\( \)
to g
roup e
xpre
ssio
ns:
$ expr \( $var1 + $var2 \) \* 5
45
=>
Use
com
mand s
ubst
itutio
n to s
tore
the r
esu
lt in
a v
ariable
:
$ var3=$(expr $var1 / $var2)
$ echo $var3
2
Co
nd
itio
nal
Exe
cuti
on
Th
e e
xit
valu
e fro
m a
co
mm
an
d o
r g
rou
p o
f co
mm
an
ds
can
be
use
d to
de
term
ine
wh
eth
er t
o d
o t
he
nex
t co
mm
and
:
co
mm
an
d1
&&
co
mm
an
d2
if
(com
man
d1 s
ucc
essf
ul)
th
en d
o (c
omm
and2
)
$ ls s* && rm s*
co
mm
an
d1
|| c
om
ma
nd
2
if
(co
mm
and1
not
su
cces
sfu
l) t
hen
do
(com
man
d2)
$ cd /dir1 || echo Cannot change to /dir1
test
Co
mm
and
Th
e t
est
com
mand a
llow
s yo
u to test
for
a g
iven c
onditi
on:
test expression
or
[ expression ]
or [[ expression ]]
Th
e t
est
com
mand e
valu
ate
s th
e e
xpre
ssio
n a
nd r
etu
rns
tru
e o
r fa
lse.
Op
erat
or:
Ret
urn
s tr
ue,
if:
$string1 = $string2
Str
ing
s a
re e
qu
al
$string1 != $string2
Str
ing
s a
re n
ot e
qu
al
$number1 -eq $number2
Nu
mb
ers
are
eq
ua
l
$number1 -ne $number2
Nu
mb
ers
are
no
t e
qu
al
-a $file
File
exi
sts
-d $file
File
is a
dire
cto
ry
-r $file
File
is r
ea
da
ble
-w $file
File
is w
rita
ble
if C
om
man
d
ifco
nd
itio
n is
tru
eth
enca
rry
ou
t th
is s
et o
f ac
tio
ns
else
carr
y o
ut
thes
e al
tern
ativ
e ac
tio
ns
fi}
op
tio
nal
$ cat active
USAGE="$0: userid"
if [[ $# -ne 1 ]]
then
echo "Proper Usage: $USAGE"
exit 1
fi
if who | grep $1 > /dev/null
then
echo "$1 is active"
else
echo "$1 is not active"
fi
exit 0
$ cat check_user
USAGE="$0 username"
if [[ $# -ne 1 ]]
then
echo "Proper usage: $USAGE"
exit 2
fi
grep $1 /etc/passwd >/dev/null
if [[ $? -eq 0 ]]
then
echo "$1 is a valid user"
exit 0
else
echo "$1 is not a valid user"
exit 1
fi
Act
ivit
y: W
riti
ng
Sh
ell S
crip
ts
if $0 $
1
exi
t -
ne
-
eq
$
?
read
Co
mm
and
The r
ead
com
mand r
eads
one li
ne fro
m s
tandard
input and a
ssig
ns
the
va
lue
s o
f e
ach
fie
ld t
o a
sh
ell
varia
ble
.
$ cat delfile
# Usage: delfile
echo "Please enter the file name:"
read name
if [[ -f $name ]]
then
rm $name
else
echo "Error: $name is not an ordinary file"
fi
for
Lo
op
Syn
tax fo
r v
ariable
in
lis
td
o
c
om
ma
nd
(s)
do
ne
$ cat count
for var in file1 file2 file3
do
wc -l $var
done
$ count
18 file1
20 file2
12 file3
$ cat rm_tmp
for file in /tmp/*
do
echo "Removing $file"
rm $file
done
wh
ile L
oo
p S
ynta
x
wh
ile e
xpre
ssio
nd
o
co
mm
an
d(s
)d
on
e
$ cat information
x=1
while [[ $x -lt 9 ]]
do
echo "It is now $(date)"
echo "There are $(ps -e | wc -l) processes running"
echo "There are $(who | wc -l) users logged in"
x=$(expr $x + 1)
sleep 600
done
Co
mm
and
Sea
rch
Ord
er
Res
erve
d
wo
rd
alia
s
B
uilt
-in
com
man
dF
un
ctio
n
PA
TH
vari
able
Qu
alif
ied
pat
hn
ame
Sam
ple
.p
rofi
le
PATH=/bin:/usr/bin:/etc:$HOME/bin:.
PS1='$PWD => '
ENV=$HOME/.kshrc
if [ -s "$MAIL" ]
then
fi
echo "Enter Terminal Type (Default:ibm3151):\c"
read a
if [ -n "$a" ]
then
TERM=$a
else
TERM=ibm3151
fi
echo "It is now $(date) "
echo "There are $(ps -e | wc -l) processes running"
echo "There are $(who | wc -l) users logged in"
export PATH ENV TERM PS1
Nex
t S
tep
...
Exe
rcis
e 1
5
Un
it 1
5: C
hec
kpo
int
1.W
hat w
ill the follo
win
g p
iece
of co
de d
o?
TERMTYPE=$TERM
if [ $TERMTYPE != "" ]
then
if [ -f /home/team01/customized_script ]
then
/home/team01/customized_script
else
echo No customized script available !
fi
else
echo You do not have a TERM variable set !
fi
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________
2.W
rite
a s
crip
t th
at w
ill m
ulti
ply
any
two n
um
bers
togeth
er.
Su
mm
ary
Po
siti
on
al p
aram
eter
s a
re u
sed
to
pa
ss to
scr
ipts
th
e
com
ma
nd
lin
e a
rgu
me
nts
To t
est
for
a p
art
icula
r co
nditi
on t
he t
est
com
ma
nd
ca
n
be
use
d. T
his
fe
atu
re is
co
up
led
with
th
e i
f st
ate
me
nt
to
con
tro
l th
e flo
w o
f a
pro
gra
m a
nd
allo
w fo
r co
nd
itio
na
l e
xecu
tion
with
in s
crip
ts
Th
e r
ead
co
mm
an
d c
an
be
use
d to
imp
lem
en
t in
tera
ctiv
e
scri
pts
Th
e w
hile
co
mm
an
d is
use
d to
ma
inta
in lo
op
s u
ntil
a
con
diti
on
fa
ils
Th
e f
or
com
ma
nd
allo
ws
to r
ep
ea
t a
se
ctio
n o
f co
de
a
fixe
d n
um
be
r o
f tim
es
Un
it 1
6
AIX
win
do
ws
Co
nce
pts
Ob
ject
ives
After
com
ple
ting this
unit,
stu
dents
should
be a
ble
to:
Lis
t th
e a
dva
nta
ges
of th
e A
IXw
indow
s envi
ronm
ent
Exp
lain
the A
IXw
indow
s cl
ien
t/se
rver
mo
del
Sta
rt A
IXw
indow
s and in
itia
te X
clie
nts
Move
, re
size
, m
axi
miz
e, m
inim
ize a
nd c
lose
AIX
win
dow
s
Sta
rt a
n a
ixte
rm w
indow
Dis
pla
y re
mo
te c
lien
ts o
n y
our
syst
em
Th
e E
volu
tio
n o
f X
Win
do
w
1987
198
8 1
989
199
0 1
991
199
2 1
996
...
X C
on
sort
ium
OS
F
CO
SE
X11
R1
X11
R2
X11
R3
X11
R4
X11
R5
Motif
1.0
Motif
1.1
Motif
1.2
CD
E 1
.0
X11
R6
.1
Motif
2.1
AIX
win
dow
s in
cludes
X W
indow
, M
otif
and C
DE
Wh
at is
AIX
win
do
ws?
AIX
win
do
ws
is I
BM
's e
nh
ance
men
t to
X W
ind
ow
and
Mo
tif
Th
e w
ind
ow
s e
na
ble
yo
u to
wo
rk w
ith
mu
ltip
le it
ems
sim
ulta
ne
ou
sly
Pro
vid
es w
ind
ow
fu
nct
ion
s su
ch a
s: o
pe
nin
g, si
zin
g
an
d m
ovi
ng
Pro
vid
es
the
ca
pa
bili
ty t
o m
anag
e lo
cal a
nd r
emo
te
dis
pla
ys
An
X W
ind
ow
Net
wo
rk C
on
fig
ura
tio
n
Net
wo
rked
Wo
rkst
atio
ns
an
d F
ile S
erv
ers
He
tero
ge
ne
ou
s E
nvi
ron
me
nt
A C
lien
t/S
erve
r E
nvi
ronm
ent
X-S
tatio
n RS
/60
00
Wo
rkS
tatio
n
RIS
C W
ork
Sta
tion
RS
/60
00
Wo
rkS
tatio
n
RS
/60
00
Se
rve
r
Inte
l PC
Th
e C
lien
t/S
erve
r E
nvi
ron
men
t
(Sys
tem
A)
(Sys
tem
B)
X C
lien
ts
X c
lien
ts a
re the a
pp
licat
ion
s w
hic
h th
e u
ser
run
s u
nd
er
the
X w
ind
ow
sys
tem
:E
xam
ple
s: a
ixte
rm, xt
erm
, xc
lock
, xc
alc
, xw
d, m
wm
X c
lien
ts c
an
be
sta
rte
d fro
m th
e c
om
man
d li
ne
or
from
sp
eci
al s
tart
up
file
s
Most
X c
lients
share
the s
ame
op
tio
ns :
-bg
co
lor
Co
lor
for
the
win
do
w b
ack
gro
un
d
-bd
co
lor
Co
lor
for
the
win
do
w b
ord
er
-bw
nu
mb
erW
idth
in p
ixe
l of th
e w
ind
ow
bo
rde
r
-dis
pla
y h
ost
nam
e:n
um
ber
Ide
ntif
ies
ho
st s
erv
er
na
me
an
d X
Se
rve
r d
isp
lay
nu
mb
er
-fg
co
lor
Co
lor
for
the
win
do
w fo
reg
rou
nd
-fn
fo
nt
No
rma
l siz
ed
te
xt f
on
tse
t
Th
e X
Ser
ver
Ea
ch X
Se
rve
r:
Co
ntr
ols
on
e k
eyb
oar
d, one m
ou
se a
nd
on
e o
r m
ore
sc
reen
s
Allo
ws
sim
ult
aneo
us
acce
ss b
y se
vera
l clie
nts
Pe
rfo
rms
bas
ic g
rap
hic
op
erat
ion
s
Pro
vid
es
info
rma
tion
su
ch a
s fo
nts
and c
olo
rs
Ro
ute
s ke
ybo
ard
an
d m
ou
se in
pu
t to
the c
orr
ect
clie
nts
Sta
rtin
g A
IXw
ind
ow
$ startx
Exi
t: <Ctrl><Alt><Backspace>
Act
ivit
y: A
IXw
ind
ow
s C
on
cep
ts
xterm
?
1. W
hic
h c
om
ma
nd
sta
rts
AIX
win
do
ws
and the
X S
erve
r on s
yste
m m
ars?
__
__
__
__
__
__
_
2.
Co
mp
lete
th
e f
ollo
win
g c
om
ma
nd
to
sta
rt a
n x
term
fro
m m
oo
n o
n m
ars:
$ xterm -______ _____:_
3. W
hic
h e
nvi
ron
men
t va
riab
le is
use
d b
y X
Cli
ents
if n
o o
ptio
n is
sp
eci
fied
?
_
__
__
__
__
__
__
_
4.
Tru
e o
r fa
lse
: B
efo
re s
tart
ing
th
e x
term
clie
nt on m
oo
n,
the s
tart
x co
mm
an
d m
ust
be e
xecu
ted o
n t
he c
lient sy
stem
.
5. T
he
sta
rtx
com
mand f
ails
. W
hic
h f
ile d
esc
ribes
poss
ible
err
or
reaso
ns?
__
__
__
__
__
__
__
X S
erv
er
0
mars
moon
An
AIX
win
do
ws
Dis
pla
y
aix
term
win
dow
sxc
lock xc
alc
root
win
dow
iconifi
ed w
indow
Inp
ut
Fo
cus
Use
th
e m
ou
se t
o s
ele
ct t
he
act
ive
win
do
w (
focu
sin
g)
On
ly o
ne
win
do
w c
an
ha
ve i
np
ut
focu
s (a
ctiv
e w
ind
ow
)
Typ
es
of fo
cus:
Exp
licit
: C
lick
acti
ve w
ind
ow
with
left
mo
use
button
Po
inte
r : A
ctiv
ate
s w
ind
ow
wh
ich
is u
nd
er t
he
po
inte
r
Ch
an
ge
th
e d
efau
lt f
ocu
s p
olic
y in
$H
OM
E/.X
def
ault
s:
Mwm*keyboardFocusPolicy: pointer
Th
e M
ou
se P
oin
ter
and
Lo
cati
on
Cu
rso
r
Mo
use
contr
ols
the m
ove
ment of th
e p
oin
ter
Po
inte
r is
use
d to
act
ivat
e m
enu
s c
han
ge
win
do
w f
ocu
s
Lo
cati
on
cu
rso
r dete
rmin
es
where
key
bo
ard
inp
ut
will
appear
Mouse
Poin
ter
Loca
tion C
urs
or
Ap
p A
$ $ _
Th
e M
oti
f W
ind
ow
Fra
me
Min
imiz
e(ico
nify
)M
axi
miz
eT
itle B
arW
indow
Menu
Re
sto
re
Alt+
F5
Mo
ve
Alt+
F7
Siz
e
Alt+
F8
Min
imiz
e
Alt+
F9
Ma
x im
ize
Alt+
F10
Lo
we
r
Alt+
F3
Clo
se
Alt+
F4
Ic
on
= s
ma
ll g
rap
hic
s re
pre
sen
tatio
n o
f a
win
do
w
D
ou
ble
clic
kin
g o
n the ic
on w
ill r
est
ore
the w
indow
Ico
ns
No
rmal
ized
Win
do
wIc
on
ifie
d W
ind
ow
Clic
k th
e m
inim
ize
bu
tto
n t
o ic
onify
the
win
do
w
Th
e ai
xter
m W
ind
ow
An
aix
term
ca
n b
e s
tart
ed
in tw
o w
ays
: I
n a
sh
ell,
by
usi
ng
th
e c
om
ma
nd
aixterm &
Dis
pla
y th
e Root Menu
and s
ele
ct New Window
aixt
erm
Co
mm
and
Lin
e O
pti
on
s
Th
e fo
llow
ing
exa
mp
les
illu
stra
te s
om
e o
f th
e m
ost
co
mm
on
ly
use
d c
om
man
d li
ne
op
tio
ns :
aixterm -display SYSTEMB:0 &
aixterm -bg red -fg white -fn rom10 -geometry 80x40+0+0 &
aixterm -T PAYROLL &
aixterm -sb -leftscroll &
Th
e ro
ot
Win
do
w
Root
Menu
New
Win
dow
Clie
nts
Cust
om
Re
fre
shP
ack
Ico
ns
Re
sta
rt ...
En
d S
ess
ion
Clic
k th
e r
igh
t m
ou
se b
utt
on
Ru
nn
ing
a C
lien
t o
n A
no
ther
Sys
tem
$ rexec sys2 aixterm -display sys1:0
sys1
aix
term
-d
isp
lay
sys1
:0
sys2
Th
e xh
ost
Co
mm
and
Th
e x
ho
st c
om
ma
nd
ad
ds
and d
elet
es h
ost
s o
n t
he
list
of
ma
chin
es
fro
m w
hic
h t
he
X S
erv
er
acce
pts
co
nn
ecti
on
s :
xhost [ + | - ] [ hostname ]
$ xhost + moon
$ xhost - pluto
$ xhost +
Allo
w m
oon to s
tart
X
clie
nts
De
ny
plu
to t
o s
tart
X
clie
nts
Allo
w a
ll h
ost
s to
st
art
X c
lients
Nex
t S
tep
...
Eerc
ise 1
6
Un
it 1
6: C
hec
kpo
int
1.I
f ru
nnin
g A
IXw
indow
s, w
hat w
ould
the follo
win
g c
om
mand d
o?
xclock -bg red -fg white &
___________________________________________________
___________________________________________________
2.L
ist tw
o w
ays
to s
tart
a n
ew
aixterm
. _
__________________________________________________
___________________________________________________
3.A
ssum
e tw
o s
yste
ms:
nysys
(in
New
Yo
rk)
and dalsys
(in
Dalla
s).
What w
ould
be the r
esu
lt if
the follo
win
g c
om
mand w
ere
issu
ed
from
the A
IXw
indow
s envi
ronm
ent on dalsys
?
rexec nysys xclock -d dalsys:0
___________________________________________________
4.W
hat is
an e
asy
way
to c
ust
om
ize y
our
AIX
win
dow
s envi
ronm
ent?
___________________________________________________
___________________________________________________
___________________________________________________
Su
mm
ary
AIX
win
do
ws
is A
IX's
win
do
win
g s
yste
m. It in
clu
de
s X
W
ind
ow
s, M
otif
an
d C
DE
Th
e X
clie
nt is
th
e a
pp
lica
tion
th
at d
isp
lays
th
e g
rap
hic
s w
hile
th
e X
se
rve
r co
ntr
ols
th
e d
isp
lay
scre
en
an
d in
pu
t
Sta
rt A
IXw
indow
s usi
ng the s
tart
x co
mm
and
Use
AIX
win
do
ws
to m
ove
, re
size
, m
axi
miz
e, m
inim
ize
a
nd
clo
se w
ind
ow
s
Use
th
e D
ISP
LA
Y v
aria
ble
or
the
-d
isp
lay
op
tion
to
d
esi
gn
ate
wh
ich
se
rve
r a
clie
nt
will
se
nd
its
ou
tpu
t to
Un
it 1
7
Cu
sto
miz
ing
AIX
win
do
ws
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Exp
lain
th
e p
urp
ose
of th
e A
IXw
ind
ow
s S
tart
up
file
s:
.xin
itrc,
.X
defa
ults
, .m
wm
rc
Use
th
e A
IXw
ind
ow
s cu
sto
m to
ol t
o c
ust
om
ize
a u
ser's
A
IXw
ind
ow
's e
nvi
ron
me
nt
Use
th
e x
setr
oo
t co
mm
an
d to
cu
sto
miz
e th
e r
oo
t w
ind
ow
AIX
win
do
ws
Sta
rtu
p O
verv
iew
$ startx
(xin
it).x
init
rc
mw
m
.Xd
efau
lts
.mw
mrc
.xin
itrc
...
#***********************************************************
# start xclock then sleep 1 to make sure it can get started.
#***********************************************************
xclock -geometry -0+0 -fg AntiqueWhite1 -bg grey60 -update 1
sleep 1
...
#**********************************************************
#
# Start the X clients. Change the following lines to
# whatever command(s) you desire!
# The default clients are an analog clock (xclock), a
# terminal emulator (aixterm), and the Motif Window
# Manager (mwm).
#
xsetroot -solid grey60
aixterm =80x25+0-0 &
exec mwm
xclo
ck
aix
term
Mo
tif W
ind
ow
M
an
ag
er
Geo
met
ry S
pec
ific
atio
ns
for
Clie
nts
Ap
p A
$ $
+0
+0
-0+
0
+0-0
-0-0
Th
e C
olo
r D
atab
ase
The f
ile /u
sr/li
b/X
11/r
gb
.txt
conta
ins
a li
st o
f val
id c
olo
rs:
112 219 147
aquamarine
50 204 153
medium aquamarine
50 204 153
MediumAquamarine
0 0 0
black
0 0 255
blue
95 159 159
cadet blue
95 159 159
CadetBlue
The X
Ser
ver
loads
this
co
lor
dat
abas
e by
defa
ult
To v
iew
and s
elec
t va
lid c
olo
rs u
se the c
om
mand:
$ custom -e color
Fo
nts
Fo
nts
are
sto
red
in t
he
dire
cto
ry /u
sr/li
b/X
11/f
on
ts
To
list
all
the
fon
ts a
vaila
ble
use
th
e c
om
ma
nd
:
$ custom -e font
.Xd
efau
lts
U
se .X
def
ault
s to c
ust
om
ize
your
AIX
win
dow
s
$ vi $HOME/.Xdefaults
Aixterm*background:
grey
Aixterm*foreground:
navy
Aixterm*font:
rom10
xclock*update:
1
Mwm*keyboardFocusPolicy:
explicit
.mw
mrc
$ cp /usr/lpp/X11/defaults/Motif1.2/system.mwmrc $HOME/.mwmrc
$ vi $HOME/.mwmrc
Menu DefaultRootMenu
{" Root Menu "
f.title
no-label
f.separator
" New Window "
f.exec "aixterm"
" My Window "
f.exec "aixterm -bg white -fg navy"
" Clients "
f.menu "clients"
" Custom "
f.exec "custom"
no-label
f.separator
" Refresh "
f.refresh
" Pack Icons "
f.pack_icons
no-label
f.separator
" Restart ... "
f.restart
" Quit ... "
f.quit_mwm
no-label
f.separator
" End Session "
f.menu "end_session"
} :wq
Do
no
t d
irec
tly
edit
th
e sy
stem
wid
e sy
stem
.mw
mrc
!
Nex
t S
tep
... E
erc
ise
17
AIX
win
do
ws
'cu
sto
m' A
pp
licat
ion
Ro
ot M
en
u
New
Win
dow
Clie
nts
Cu
sto
m
Re
fre
shP
ack
Ico
ns
Re
sta
rt ...
En
d S
ess
ion
Th
e 'c
ust
om
' Win
do
w
Cu
sto
miz
ing
an
aix
term
Th
e A
IXw
ind
ow
s C
olo
r B
row
ser
Sav
ing
th
e C
ust
om
ized
Ch
ang
es
Th
e xs
etro
ot
Co
mm
and
Cu
sto
miz
e t
he
ro
ot
win
do
w u
sing the x
setr
oo
t co
mm
and
$ xsetroot -solid black
$ xsetroot -cursor_name gumby
$ xsetroot -bitmap /usr/include/X11/bitmaps/xsnow
Per
man
entl
y cu
sto
miz
e t
he
ro
ot
win
do
w in
.xin
itrc
Nex
t S
tep
... E
erc
ise
18
Un
it 1
7: C
hec
kpo
int
1.M
atc
h t
he
AIX
win
do
ws
sta
rtu
p f
ile w
ith it
s fu
nct
ion
:
a) .
xin
itrc
__
Se
ts d
efa
ult
cha
ract
erist
ics
fo
r A
IXw
ind
ow
s re
sou
rce
sb
) .X
def
ault
s_
_S
tart
s th
e M
otif
Win
do
w
Ma
na
ge
rc)
.m
wm
rc_
_D
efin
es
the
fu
nct
ion
of th
e
roo
t m
en
u a
nd
th
e w
ind
ow
m
en
u
2.N
am
e t
wo
wa
ys t
he
.Xd
efau
lts
file
ca
n b
e c
ust
om
ize
d.
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
_
3.T
rue
or
Fa
lse
: T
he
AIX
win
do
ws
cust
om
to
ol s
ave
s a
ll cu
sto
miz
atio
n
cho
ice
s in
th
e .x
init
rc f
ile.
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
_
4.W
ha
t co
mm
an
d is
use
d t
o c
ha
ng
e t
he
ap
pe
ara
nce
of
the
ro
ot
win
do
w?
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
_
5.W
he
re w
ou
ld th
e x
setr
oo
t co
mm
an
d b
e p
lace
d t
o m
ake
a p
erm
an
en
t ch
an
ge
to
th
e r
oo
t w
ind
ow
?_
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
__
Su
mm
ary
Th
e .x
init
rc file
co
ntr
ols
wh
ich
win
do
ws
to s
tart
du
rin
g
AIX
win
do
ws
sta
rtu
p.
Th
is f
ile s
tart
s m
wm
last
.
Th
e .X
def
ault
file
cu
sto
miz
es
vario
us
AIX
win
do
ws
reso
urc
es
use
d b
y a
use
r.
Th
e .m
wm
rc file
cu
sto
miz
es
the
ro
ot m
en
u, th
e w
ind
ow
m
enu a
nd the b
ehavi
or
of th
e m
ouse
.
Use
th
e A
IXw
ind
ow
s 'c
ust
om
' tool t
o c
ust
om
ize the
win
do
ws
en
viro
nm
en
t
Th
e x
setr
oo
t co
mm
an
d w
ill c
ust
om
ize
th
e r
oo
t w
ind
ow
.
Un
it 1
8
Usi
ng
th
e C
om
mo
nD
eskt
op
En
viro
nm
ent
(CD
E)
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
De
scrib
e th
e g
oal
of
the
Co
mm
on
De
skto
p E
nvi
ron
me
nt
(CD
E)
Use
the v
arious
CD
E c
om
po
nen
ts
Ob
ject
ives
Co
mm
on
Des
kto
p E
nvi
ron
men
t (C
DE
)
X11
/Mo
tif
IBM
's C
UA
and
Wo
rkp
lace
Sh
ell
Su
nS
oft
's:
OP
EN
LO
OK
ele
men
tsD
eskS
et p
rod
uct
ivit
y to
ols
To
olT
alk
mes
sag
ing
sys
tem
HP
's V
UE
US
L's
Des
kto
pM
anag
eran
d s
cale
able
syst
ems
tech
no
log
y
CD
E
Th
e C
om
po
nen
ts o
f th
e C
DE
Des
kto
p
Th
e L
og
in M
anager
Th
e F
ron
t P
an
el
Th
e S
tyle
Manager
Th
e F
ile M
an
ag
er
Th
e A
pp
licat
ion
Manager
Per
son
al A
pp
lica
tion
s
Th
e H
elp
Ma
na
ge
r
Th
e S
essi
on
Manager
Th
e L
og
in M
anag
er
$HO
ME
/.dtp
rofi
le
Se
ts e
nvi
ron
men
t va
riab
les
wh
en
usi
ng
CD
E
By
de
fau
lt, .p
rofi
le w
ill b
e ig
no
red
To
fo
rce
a re
ad o
f .p
rofi
le, u
nco
mm
en
t la
st li
ne
of
.dtp
rofi
le t
o r
ea
d:
$ vi $HOME/.dtprofile
...
DTSOURCEPROFILE=true
:wq
Fro
nt
Pan
el
Cale
ndar
File
M
anager
Maile
rP
rinte
rSty
le
Manager Applic
atio
n
Manager
Help
Pers
onal
Applic
atio
ns
Subpanel
Work
space
S
witc
h
Tra
sh
Fro
nt
Pan
el -
Su
bp
anel
s
Su
bp
anel
Inst
all I
con
Are
a
Su
bp
anel
Co
ntr
ols
Su
bp
anel
acce
ssar
ea
Fro
nt
Pan
el -
Fu
rth
er C
on
tro
ls
Work
space
Sw
itch
On
eT
wo
Thre
eF
our
Lo
ck Gra
ph
ica
l W
ork
spa
ce
Ma
na
ge
r
Bu
sy
Exi
t
Act
ivit
y: W
hat
's T
his
?
C_
__
__
_
F_
__
M_
__
__
_
P_
__
__
_A
__
__
__
_S
__
__
__
L___
M_
__
__
W_
__
__
__
_S
__
__
__
E_
__
S____
M______ A
______
M______
H___
S______
T_
__
_
Th
e S
tyle
Man
ager
Th
e S
tyle
Man
ager
allo
ws
inte
ract
ive c
ust
om
izat
ion
of
the d
esk
top e
nvi
ronm
ent
Th
e F
ile M
anag
er
Na
vig
ate
file
sys
tem
Wo
rk w
ith file
s a
nd
dire
cto
rie
s
Dra
g a
nd d
rop a
ctio
ns
Launch
applic
atio
ns
Th
e A
pp
licat
ion
Man
ager
Th
e P
erso
nal
Ap
plic
atio
ns
Man
ager
Pe
rso
na
l Ap
plic
atio
n
Subpanel
Th
e Te
rmin
al E
mu
lato
r
Re
ad
ily a
vaila
ble
fro
m:
Th
e H
elp
Sys
tem
Help
Key
Ap
plic
atio
n H
elp
Menu
Help
Subpanel
Th
e S
essi
on
Man
ager
log
ou
tlo
gin
Th
e S
essi
on
Man
ager
is r
esp
onsi
ble
for
sett
ing
up
th
e u
ser'
s d
eskt
op
en
viro
nm
ent
after
login
pro
cess
ing h
as
com
ple
ted.
Th
e C
DE
Mai
l Pro
gra
m
CD
E M
ail P
rog
ram
- S
end
a M
essa
ge
Th
e C
alen
dar
Man
ager
Cal
end
ar A
pp
oin
tmen
ts
Nex
t S
tep
...
Exe
rcis
e 1
9
1.T
rue
or
fals
e?
CD
E is
de
sig
ne
d a
s a
co
mm
on
use
r in
terf
ace
fo
r th
e
UN
IX e
nvi
ron
men
t.
2.M
atc
h t
he
fo
llow
ing
te
rms
with
th
eir c
orr
ect
me
an
ing
s:
a.L
og
in M
an
ag
er
__
Ca
n b
e u
sed
to
ob
tain
a
dtt
erm
b.F
ron
t P
an
el
__
Ca
n b
e u
sed
to
wo
rk w
ith
on
line
do
cum
en
tatio
nc.
Pe
rso
na
l Ap
plic
atio
ns
__
Use
d t
o c
ust
om
ize
CD
Ed
.File
Ma
na
ge
r_
_T
he
ap
plic
atio
n "
La
un
che
r"e
.Ap
plic
atio
n M
an
ag
er
__
Ma
inta
ins
de
skto
p lo
ok
b
etw
ee
n s
ess
ion
sf.
Sty
le M
an
ag
er
__
Pro
vid
es
a G
UI
to w
ork
with
fil
es
g.S
ess
ion
Ma
na
ge
r_
_U
sed
to
ma
na
ge
ap
plic
atio
ns
h.H
elp
Ma
na
ge
r_
_A
uth
en
tica
tes
the
use
r ID
3.T
rue
or
fals
e?
An
y e
nvi
ron
me
nt
varia
ble
s se
t in
.p
rofil
e w
ill b
e
use
d b
y d
efa
ult
in t
he
CD
E e
nvi
ron
me
nt.
Un
it 1
8: C
hec
kpo
int
The C
DE
pro
vides
a c
om
mon u
ser
inte
rface
for
the u
ser
envi
ronm
ent
After
loggin
g in
to C
DE
, th
e F
ront P
anel p
rovi
des
acc
ess
to
the v
arious
CD
E c
ontr
ols
:C
ale
ndar
File
Manager
Pers
onal A
pplic
atio
ns
Ma
ilP
rintin
g F
unct
ions
The S
tyle
Manager
The A
pplic
atio
n M
anager
The H
elp
Manager
Tra
sh
The F
ront P
anel a
lso c
onta
ins
a W
ork
space
Sw
itch a
nd the
abili
ty to lo
ck a
dis
pla
y or
log o
ut
Su
mm
ary
Un
it 1
9
CD
E U
ser
Cu
sto
miz
atio
n
Ob
ject
ives
Aft
er
com
ple
ting
th
is u
nit,
stu
de
nts
sh
ou
ld b
e a
ble
to
:
Use
the S
tyle
Man
ager
to
inte
ract
ive
ly c
ust
om
ize
th
e
de
skto
p e
nvi
ron
me
nt
Cu
sto
miz
e t
he
Fro
nt
Pan
el
Cu
sto
miz
ing
CD
E
Mo
st f
eatu
res
of
CD
E a
re c
ust
om
izab
le
Fro
nt p
an
el l
ayo
ut
Fo
nts
, C
olo
rs,
Ba
ckd
rop
Wo
rksp
ace
Sw
itch
Inte
ract
ive T
ools
Com
mand L
ine
Optio
ns
Config
ura
tion
File
s
Sty
le M
anag
er O
verv
iew
Sty
le M
anag
er -
Co
lors
Sty
le M
anag
er -
Fo
nts
Sty
le M
anag
er -
Bac
kdro
ps
Sty
le M
anag
er -
Key
bo
ard
, Mo
use
an
d B
eep
Key
clic
k vo
lum
eC
hara
cter
repeat
capabili
ty
Mo
use
bu
tto
n c
lick
sett
ing
sD
ou
ble
clic
k sp
ee
dP
oin
ter
acc
ele
ratio
nP
oin
ter
mo
vem
en
t th
resh
old
Vo
lum
eT
on
eD
ura
tion
Sty
le M
anag
er -
Win
do
w, S
cree
n a
nd
Sta
rtu
p
Win
do
w f
ocu
s p
olic
yW
indow
rais
es
polic
yW
ind
ow
ico
ns
pla
cem
en
t
Scr
ee
n s
ave
rL
ock
tim
eo
ut
Cu
rre
nt S
ess
ion
or
Ho
me
S
ess
ion
Wh
eth
er
to p
rom
pt a
t lo
go
ut tim
e fo
r su
bse
qu
en
t se
ssio
n
Act
ivit
y: R
evie
w S
tyle
Man
ager
Gen
eral
Str
uct
ure
of
a F
ron
t P
anel
Box
Panel
Subpanel
Sw
itchC
ontr
ol
Contr
ol
Contr
ol
Cre
atin
g a
New
Wo
rksp
ace
Sw
itch
Are
a
Add W
ork
space
Help
Clic
k th
e r
igh
t m
ou
se b
utt
on
Ch
ang
ing
a W
ork
spac
e N
ame
Wo
rksp
ace
Ne
w
Add W
ork
space
De
lete
Renam
e
Help
Clic
k th
e r
igh
t m
ou
se b
utton
Joes
Dyn
amic
Cre
atio
n o
r D
elet
ion
of
a S
ub
pan
el
Ma
iler
Add S
ubpanel
He
lp
Clic
k th
e r
igh
t m
ou
se b
utton
Ad
din
g a
Co
ntr
ol t
o a
Su
bp
anel
Dra
g t
he
Act
ion
Ic
on
onto
the
Inst
all
Ico
n
Co
py
a S
ub
pan
el C
on
tro
l to
th
e M
ain
Pan
el
Term
ina
l
Te
rmin
al
Copy
to M
ain
Panel
De
lete
He
lp
Clic
k th
e r
igh
t m
ou
se b
utt
on
Ad
din
g C
on
tro
ls t
o t
he
Fro
nt
Pan
el (
1)
1.
Ad
d t
he
Co
ntr
ol t
o a
Su
bp
an
el:
2.
Fin
d o
ut
the n
am
e o
f th
e d
efin
itio
n f
ile f
or
this
co
ntr
ol:
$ ls $HOME/.dt/types/fp_dynamic
Dtcalc1.fp
Ad
din
g C
on
tro
ls t
o t
he
Fro
nt
Pan
el (
2)3
. C
op
y th
e d
efin
itio
n f
ile to
dire
cto
ry $
HO
ME
/.d
t/ty
pe
s
$ cp $HOME/.dt/types/fp_dynamic/Dtcalc1.fp $HOME/.dt/types/joe.fp
4.
An
cho
r th
e C
ontr
ol i
n t
he F
ront
Panel:
$ vi $HOME/.dt/types/joe.fp
CONTROL Dtcalc
{
...
CONTAINER_TYPE BOX
CONTAINER_NAME Top
POSITION_HINTS last
...
}
5.
Res
tart
th
e C
DE
6.
If y
ou
ca
n n
ot
log
in t
o t
he
CD
E,
use
Fai
lsaf
e S
essi
on
login
.
Ext
end
ed F
ron
t P
anel
Nex
t S
tep
...
Exe
rcis
e 2
0
Un
it 1
9: C
hec
kpo
int
1.H
ow
do y
ou c
ust
om
ize t
he s
creen s
ave
r in
your
desk
top
en
viro
nm
en
t ?
2.T
rue
of
fals
e:
You
ca
n h
ave
mo
re t
ha
n f
ou
r w
ork
spa
ces
on
th
e
CD
E f
ron
t p
an
el.
3.D
esc
rib
e h
ow
co
ntr
ols
ca
n b
e a
dd
ed
to
th
e C
DE
fro
nt p
an
el.
Su
mm
ary
Use
th
e S
tyle
Ma
na
ge
r to
inte
ract
ive
ly c
ust
om
ize
CD
E
for
colo
r, fo
nts
, b
ack
dro
p, m
ou
se, ke
ybo
ard
, b
ee
p a
nd
w
ind
ow
be
ha
vio
r, th
e s
cre
en
sa
ver
an
d s
tart
up
op
tion
s
Inte
ract
ive
ly c
ust
om
ize
th
e F
ron
t P
an
el t
o a
dd
an
d
ren
am
e w
ork
spa
ce s
witc
he
s, a
dd
or
de
lete
a s
ub
pa
ne
l, a
dd
or
de
lete
a c
on
tro
l in
a s
ub
pa
ne
l, a
nd
co
py
a
sub
pa
ne
l co
ntr
ol t
o th
e M
ain
Pa
ne
l
To
ad
d c
on
tro
ls t
o t
he
fro
nt
pa
ne
l, a
dd
th
em
first
to
a
sub
pa
ne
l. C
op
y th
e d
efin
itio
n file
an
d a
nch
or
the
co
ntr
ol
in th
e fro
nt p
an
el