You are on page 1of 233

6 32-973.26-018.

2
http://itbookz.ru/

! , ITBookZ.ru.
:
,
, ! , IT ,
.. .
:


WEB-
MS Office

1C
, , 3D

IT .
!

!
!
, !
ITBookZ.ru
:


.
, ,
,
.
,
.
:
.
,
, ,
.
.
,
ITBookZ.ru
http://itbookz.ru/

. .
Linux: .
/
. . - .: -, 2005. - 288 .


, .

, shell, X
Window.
Linux, ,
.
.

Linux: .
-

. . .
-
.: 333-82-11; E-mail: ok@kudiis.ra; ]irtp://boob.kudi 119049.
, -., . 4, crp. 1A
70x90/32. '1.1, . . .
10,53, 3000. , :536

?......................................... 9
Linux? ......................................... 10

2
http://itbookz.ru/

Fedora Linux? ............................. 12


? .................................... 12
.......... 14
.................................. 15
.................................. 19
Fedora: .............................. 21
.................... 23
...............24
/ ......... 25
.................................... 27
............................... 30
.............................. 31
........ 35
............................................ 36
:............................ 38
........ 40
bash .......................... 40
................................. 53
......... 57
...... 59
......59
.......... 60
............. 66
............................ 71
..................................... 74
....... 86
........................................ 95
......................................... 109
..................... 118
.................... 134
.................................. 139
.................. 146

............................. 154
........................................ 163
....... 165
.......................... 167
........................ 174
3
http://itbookz.ru/

.............. 177
....... 184
.................................. 190
.............. 193
............................................. 196
.............................. 201
................................. 207
- ........................... 212
Usenet ....................................... 218
..... 221
....................................... 224
........231
........................................... 235
.......................... 239
................. 246
......................................... 251
......256
............................ 256
.............................................. 257
............................... 258

........................ 258
............................... 262
........................................................ 265
Break Continue........................................ 268
shell- ........... 270
................ 271
......... 273
shell- ................... 273
.......................... 274
................................ 274
............................275

Linux.

4
http://itbookz.ru/

Linux! Linux,

Linux Fedora Linux ,
.
Linux,
.

?
- , .
, Linux ,
.
(
, ),

. , -
.
,
,
, Linux, , , , Is
( ), grep ( ), xmms
( ) df (,
).
GNOME KDE,
.
,
. ,
,
: cat - , less -
, od - , ghostview - Postscript-, . .
,
.
, Linux-
, , .

, ,
, Linux.
5
http://itbookz.ru/

Linux?
Linux -
,
Microsoft Windows Apple Macintosh.
.

,
, ,

, ,
, -
, -, ,
-.. - . .
(shell)
,
.
: Bourne shell, Kom shell, shell . bash, Bourne Again Shell, , ,
. ,
.
X
,
, , , GUI . X
; - KDE
GNOME. ,
-.

Fedora Unux?
Fedora Linux - Linux-,
Red Hat, Inc. Fedora (
6
http://itbookz.ru/

http://fed.ora. redhat. com),


Red Hat Linux*. Fedora Core 1,
( 2003).

, X .

Linux, , ,
,
. , - (
). , , , ,
, , ,
. ,
, :
$ we -I myfile
(we - "word count"),
(-1), ,
, (myfile), ,
( -
, ,
). :
* Red Hat .
, Enterprise Linux.

$ myprogram - - - rayfile
:

$ myprogram -abc myfile , - - -



.
,
.
,
( ), "",
7
http://itbookz.ru/


.
. (, -1)
: we
-1 " ",
Is

"

". ,

" """ (
): -q ("quietly") -s ("silently").
.
,
.
Linux -
.
, ,
"
": " ,
,
, .txt".

Linux - .

(username), "smith" "funkyguy",
( ) , .
root, {),
. : ,
,
. , ,
.
, ,
.
"" (#)
.
#
8
http://itbookz.ru/



.
$
,
;
su (. " "
189) .
$ SU -1
Password: ********
#

,
, . , we
(word count) :
we [] []
, "we", , ,
.
" [" "]": , ;
,
, .
, ,
:
Is ( | )
:
Is
, .


9
http://itbookz.ru/

Linux
(standard input), , ,
,
(standard output), ,
. ,
(standard error),
,
*. ,
, ,
(pipe) .
. , "" (),
, ,
. "",
,
.
* ,
.


. ,
Is (list files ):
Is [\ [/[
/bin

coreutils

stdin stdout -file --opt help version

(Is) , ,
, (/bin), RPM-,
(coreutils), ,
(),
() .
stdin
10
http://itbookz.ru/

, . .
, .
stdout
, . . ,
.
-file
(-)
,
; ,
,
. , we (word count ) fuel, file2,
, file3.
$ we filel file2 - file3
- - opt
"--", "
": ,
, .
,
() .
, -foo, we -foo ,
-foo () ,
we foo .
"--",
,
.
$ we ./-foo
- - help

11
http://itbookz.ru/

--help
, ,
, .
- - version
--version
.


.
Linux-, ^,
" Ctrl", , AD
( " D") "
Ctrl , , D".
ESC, , " Esc". ,
Enter , .

- echo

echo,
" " 224. echo - :

, .
S echo My dog has fleas
My dog has fleas
$ echo My name is $USER USER
My name is smith


12
http://itbookz.ru/

,
, .
man
man
. ,
Is,
:
man Is

, -, .
$ man -k database
info
info -
, Linux-.
$ info Is
,
info man- .
help ( ) Linux --help
. .
$ Is --help
/usr/share/doc

, ,
. , Emacs
21.3 /usr/share/doc/emacs-21.3
GNOME
GNOME KDE
Help () .
13
http://itbookz.ru/

-, Fedora Linux
- http://fedora.redhat.com.
(FAQ)
http://fedora.artoo.net. , - .
http://www.oreilly.com/catalog/linuxpg/
USENET
Usenet Linux-,
comp.os.liniix.misc comp.os. linux.questions. ,
Red Hat, alt.os.linux.redhat,
comp.os.limix. redhat, linux.redhat lima.redhat.misc. Google Groups,
http://groups.googie.com,
.
Google
Google
: http://www.google.com.

Fedora:
Fedora ( ) Linux, ,
, *, . 1,
.
* ,
, .

, Windows, ,
:
- "red hat" ( ) ,
;
- , Mozilla, Evolution
14
http://itbookz.ru/

(Print Manager) ;
- (,
),
;
- "", ,
, , ,
;
-.

,
,
" " ,

()


Fedora
, GNOME, KDE*.
, ,
"red hat", , Help.
Help ,
- GNOME KDF-.

, GNOME K.DE ,
Fedora
, twin, (
, Linux ).

15
http://itbookz.ru/

. I. Fedora


GNOME KDE.

Linux. , Fedora,
,
,
Internet.
, Linux .
Linux,
.
,
, ,
.
16
http://itbookz.ru/

Linux-,
.


GNOME,
KDE Linux,
.
, xt er m, gnome- t er mi nal, konsol e uterm.
: ,
,
. ,
Fedora,
.
... .
...
GNOME
Menu -.System Tools: Terminal
gnome-terminal
.
: Open Terminal
KDE
Menu : System Tools: Terminal
console
.
: Open Terminal
twm
:'
xterrn
: XTerm

(, konsole)
. -
, ,
,
.
, -,

, -
, . .

/
17
http://itbookz.ru/

, , Linux .
GNOME KDE, "red hat" ( )
Logout ( ) -
.
, ,
exit logout.
-
Linux:
. GNOME,
Logout ( ), Shut Down (
). KDE (log out),
Shutdown.
,
shutdown .
.
shutdown [] []
SysVinit
/sbin
stdin stdout -file --opt --help --version
shutdown
Linux; .
,
10 , "scheduled maintenance" (
) .
# shutdown -h +10 "scheduled maintenance"
,
, +10,
, 16:25, now (),
.
shutdown
- ,
(
) .
,
18
http://itbookz.ru/

shutdown, ,

^D,

-r
-h
-
-
-f
-F



,
,
c
shutdown ( )

, tsck (
" " 146}

,

man- init inittab.

Linux-,
Linux .
Linux ,
. - ,
Windows Macintosh. :
,
, .
root-
(/)*.
* Linux ,
Windows DOS,
.

19
http://itbookz.ru/

,
, (path). ,
:
/on e/two/th ree/four
/,
one, two,
three,
four. ,
, .
.
, ""
( ).
,
, ,
. ,
,
.
,
/one/two/three ,
myfile, - /one/two/three/myfile.
, // /one/two/three/a/b/c.
"."
( ) ".." ( ).
, ( ).

/one/two/three, "." , ".." -
/one/two.
""
cd.
$ cd /one/two/three

/one/ two/three.
( "/");
20
http://itbookz.ru/

,
.
$ cd d
d
$ cd . . /mydir
, -
mydir

: * , , , ,
(
"/" - ).
, ,
,
.
(. "
" 49).
* , Linux
.



/home ( ) /root (
). , ,
/home/your jtsername, yourjtsername , : /home/smith,
/home/jones . .
.
d
cd, , (. .
)
.

21
http://itbookz.ru/

(. "
" 43)
.
$ echo $HOME

echo
/home/smith


.
$ echo -/home/smith
(,
-smith),
.
$ cd -smith
$ pwd
/home/smith

Linux
.
, , ,
(, ,
/home).
,
,

. ,
" ", ""
"" ( ,
). , /usr/local/share/emacs,
Emacs,

"
"
/usr/local
(
,
), "" share (
22
http://itbookz.ru/

) "" emacs ( ), . 2. , ,
.

/usr/local / share/
Scope

Category

emacs

Applicati on

. 2. " ", ""


""(scope - , category - ,
application - )

""
, . ,
bin, -
.
.
. _ _.,.
bin
( )
sbim
( ),

lib
,
libexec , , ,
, ; :
" "


doc
info


Emacs
man
{man-),
man;
:

Share .

23
http://itbookz.ru/


etc

init.d
rc.d

(
)
Linux;
rc1.d, rc2.d...


include
sre

-
cgi-bin

/,
-
html
-
public_html - (
)
www
-


fonts
X11

(!)
X Window


dev
mnt
m/sc



: ,


var

lock

, ,

, ,
: " ";

24
http://itbookz.ru/

log

mail

/
-
,

,

run

PID-, ID ()

spool ,
,
,

tmp
,
/
r
: .
" " 35

" "

. .
/
, Linux
/usr
,
Linux
/usr/games (!)
/usr/
, Kerberos
kerberos
/usr/local , ""
,
/usr/X11R6 , X Window
, , , lib ()
Linux /lib, /usr/lib, /usr/ local/lib,
/usr/games/lib /usr/Xl JR6/lib.
"
"

: /-/ lib, /my-division/lib . .


25
http://itbookz.ru/

/
/usr, / " " ""
. , , /bin
, Is cat, /usr/bin , Linux, a
/usr/local/bin ,
. ,
.

"" -,
, . " "
"" ( /usr/local/doc)
(, /usr/local/doc/myprogram),
.

/boot
.
; , /boot/vmlinuz.
/lost+found

.
/r
;
.
/
.
,
/ .
$ Is -I /proc/version
-r--r--r--l root root 0 Oct 3 22:55 /
proc/version
26
http://itbookz.ru/

Linux.
$ cat /proc/version
Linux version 2 . 4 . 22-1. 2115 .nptl ...
.
.
/proc/ioports /

/proc/version . uname

/proc/uptime , . .
,
/roc/nnn
Linux (ID) ,
-
/proc/self
,
; /proc/,
. Is
-I /proc/self : ,

Linux
.
,
.
.
?
, , .
, , ,
(owner), .

(group)
.

,
" " 190.

27
http://itbookz.ru/

,
.
"".
? ,
(read), (write, modify)
(execute, run) .
,
( ),
( ) (
).
, ,
, ,
:
$ Is -I filename
, ,
, ,
:
$ Is -Id directory_name
- 10
, (read - ), w (write - ), (execute ) . :
drwxr-x
.

2-4
5-7

: - = , d = , 1 =
, = , =
-, =

,
28
http://itbookz.ru/

8-10

Is "
" ika 66.
, , chown,
chgrp chmod ,
" " 95.

Linux -
. "-" (shell),
Linux:
Enter,

( ).
, "Fedora:
" 21.
, ,
,
:
$ who
Barret

:0

Sep

23

20:4
4

Byrnes

pts/

Sep

15

0
Silver

pts/

Sep

22

pts/2

Sep

22

1
Silver

13:5
1
21:1
5
21:1
8

( "$" - ,
, ).
29
http://itbookz.ru/


, .
,
who we,
;
who:
$ who | we -1
4

>

, *.
, ,
who we.
,
Linux

Bash
("Bourne-Again
Shell"),
/bin/bash

::
Fedora Linux.
* ,
. , , ,
silver , who .


Linux (, who),
, .
type.
$ type who
who is /usr/bin/who
$ type cd
cd is a shell builtin
,
, , Linux.
.
30
http://itbookz.ru/

bash
,
. ,
.
,
,
, (pipe) ,
,
(alias) ,
,
, . .
,
. info bash,
.



. , *
, "".
""
, . :
$ Is *
*
, "",
.
Is aardvark adamantium apple

ls

31
http://itbookz.ru/

*
?
[ ]

,

,
, ,
, [aeiouAEiou]
, , , [-z]

[^] ,
[!]
,
.
, .
^ !, .


.
, :
{a,b,cc,ddd}

a b c dddd
,
, .
, sand{ X, Y, ZZZ}wich
$ echo sand{X,Y,ZZZ}wich
sandXwich sandYwich sandZZZwich
, .
32
http://itbookz.ru/


(~)
,
.
-smith

smith



.
$ MYVAR=3
,
.
$ echo $MYVAR
3
, ,
.

DISPLAY

LOGNAME
MAIL
OLDPWD
PATH
PWD

X-window




:
,

33
http://itbookz.ru/

SHELL
TERM
USER

,
/bin/bash
xterm vt100

,

$ printenv
(. .
)
, .
,
, export.
$ export MYVAR

$ export MYVAR=3

( ),
"" . ,

"=".
$ echo $HOME
/home/smith
$ HOME=/hame/sally echo "My home is $HOME"
My home is /home/sally
$ echo $HOME
/home/smi th

34
http://itbookz.ru/


PATH,
, .
:
$ who

().
PATH, ,
:
$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/
XllR6/bin:/home/smith/bin
who .
who (, /usr/bin/who), .
.
bash: who: command not found

, PATH. ,
/usr/sbin
, .
$ =$:/usr/sbin
$ esho $
/usr/local/bin:/bin:/usr/bin:/usr/
XllR6/bin:/home/smith/bin:/usr/sbin
,
PATH ~/.bash_profile,
" "
59. .
35
http://itbookz.ru/

alias

. :

$ alias ll="ls -I"


11,
Is -1.
$ 11
total 436
-rw-r--r-- I smith 3584 Oct 11 14:59
filel
-rwxr-xr-x 1 smith 72 Aug 6 23:04 file2

, ~/.bash_profile (.
" " 59).
,
alias.
(

),

"

" 256 info


bash

"Shell
functions"
(
).
/

,
. , ,
,
"<" ( "").
$ mycommand < infile

36
http://itbookz.ru/

, ,
,
.
$ mycoitrmand > outfile /
outfile
$ mycommand >> outfile
outfile
, ,
.
$ mycommand 2> errorfile

,
.
$ mycommand > outfile 2> errorfile $
mycommand > outfile 2>&1

, ,

.
"|" (). , :
$ who | sort
who sort,
,
.
37
http://itbookz.ru/



.
$ commandl ; command2 ; command3

, ,
,
, "&&"
( "").
$ commandl && command2 && comma.nd.3
,
, ,
|| ( "").
$ commandl \ \ command2 || command3


,
, .
, (, ,
),
,
.
,
,
, .
38
http://itbookz.ru/

$
echo
"The variable HOME has value
$HOME' The variable HOME has
value
$HOME $ echo "The variable HOME has value
$HOME" The variable HOME has value
/home/smith

;
.
$ /usr/bin/whoami
smith
$ echo My name is "/usr/bin/whoami4
My name is smith


, (,
"*" - ,
), "\".
.
$ echo *
*
""
aardvark agnostic apple
$ echo a\* *
*
$ echo "I live in $HOME"

I live in /home/smith
$ echo "I live in \$HOME"
I live in $HOME

(, , ^D . .),
39
http://itbookz.ru/

, ^V.
, (^I),
(. " " 53).
$ echo "There is a tab between
here ^V ^I land here"
There is a tab between here
and here.


bash ,
, ,
emacs vi (. "
" 86).
emacs,
(
~/.bashj>rofile,
).
$ set - emacs
vi .
$ set - vi

emacs

vi
(
ESC)

^ N

^ F

1
h
0
$

^U

^
^
^D
^U

40
http://itbookz.ru/

,
, . . ,
. .

history

history N
N
history -

!!

\N
N B
\-N
, N
!$
;
: $
Is a* $!$
!*

TAB,
, .
, , , , ,
. TAB,
.
.
$ cd /usr/bin
$ Is un<TAB><TAB>


jobs
&
^Z



()

suspend
fg

41
http://itbookz.ru/

bg

Linux
:
( ) (
) . (job) ~
.
,
.
, .
, Linux;
Linux .
.
.
(foreground job)

, ,
.
(background job)
,
,
.
(suspend)
.
(resume)
.
jobs
j obs ,
.
$ jobs
[1]- Running emacs myfile &
[2]+ Stopped su

42
http://itbookz.ru/

- ,
, fg
(foreground) (background).
&
, , ,
.
$ emacs myfile & [2] 28090
(2)
(28090). __
^Z
~Z
.
, .
$ mybigprogram
[1]+ Stopped mybigprogram $
Bg,
, f g,
.
suspend
suspend
, , Z B
. ,
su
.
A

$ whoami
smith
$ su -1
Password: *******
43
http://itbookz.ru/

#whoami
root
# suspend
[1]+ Stopped
$ whoami
smith

su

bg [%jobnumber\

bg

.
bg ,
. ( ,

jobs),

.
$ bg %2
,
, .
,
.
[2]+ Stopped

(
fg) .
fg [%jobnumber]

fg

.
, ,
,
. ( ,
jobs),
.
44
http://itbookz.ru/

$ fg %2



, ^. ^
" ". ,
(, cat)
, ^.
$ cat bigfile
This is a very long file with many
lines. Blah blah blah blah blah blah
blah blahblahblah AC
$
,
,
fg , , ,
kill (. " "
174).
,
.
, .
,
. ,
.
1. ^J,
. ,
Enter ( ), ,
Enter.
2. reset (
) ^J , .
. ^
. ,
- ,
. ,
45
http://itbookz.ru/

,
: emacs.

,
exit, AD*.
$ exit


, .bash_profile .bashrc
. ,
(~/.bash_profile) (-/.bashrc).
, , .
.

: ,
* Ctrl-D " " ,
.
, .
.
" " 256.


,
Linux-.

Fedora Linux- -
46
http://itbookz.ru/

*.-.
Red Hat Package Manager (RPM)

rpm
()

up2date
().
*.tar.gz, *.tar.Z, *.tar.bz2
tar- - tar
gzip (.gz), compress (.Z)
bzip2 (.bz2).

,
su ( ) .
:
$ su -1
Password: ********
# rpm -ivh mypackage.rpm
...etc...

- Linux- , ,
.
http://freshmeat. net/ http://freshrpms. net/ http://rpmfmd. net/
http.V/sourceforge. net/
up2date [] [!\ up2date
/usr/bin stdin stdout -file --opt --help -version
up2date -
Fedora. :
#up2date
.
.
up2date :
47
http://itbookz.ru/

#up2date -1
RPM-- (
) . ,
:
#up2date -d packages
RPM-,
up2date -d, :
#up2date -i packages
up2date RPM- Red Hat
Fedora Internet,
,
up2date.
Linux
up2date ,
yum (http://linux.duke.edu/projects/yum/)
apt (http://ayo.freshrpms.net/).

rpm [][]
rpm
/bin
stdin stdout -file -opt help --version
RPM- ,
rpm, ,
up2date. rpm
, ,

. , supers tuff ,
otherstuff,
, rpm superstuff.
, rpm
.
RPM-, , ..rpm. , emacs-20.7-l7.i386.rpm
emacs 20.7-17
48
http://itbookz.ru/

i386 (Intel 386 ). ,


rpm
(, emacs-20.7-17.i386.rpm),
(, emacs).
RPM-
:
rpm -q g_nm
,
_ , , . :
rpm -q textutils. (
, - ?),
grep
.
$ rpm - | grep -i _
rpm -ql g_nm
.
, , rpm -ql emacs.
rpm -qi g_nm
.
rpm -qlp package.rpm

RPM-,

. -qip
RPM-.
rpm -qa
RPM--.
grep
.
$ rpm -qa | grep -i emacs
49
http://itbookz.ru/

rpm -qf filename


,
.
$ rpm -qf /usr/bin/who sh-utils-2.0-11
rpm -ivh packagel. rpm package2. rpm...
, .
rpm -Fvh packagel. rpm package2. rpm... ,
.
rpm -e package__names
.
, .
, GNU Emacs emacs20.7-17. i386.rpm,
rpm - emacs, rpm -e emacs-20. 7-17.186.rpm.

tar.gz tar.bz2

,
.tar.gz Jar.bz2, ,
,
("").
1.
.
,
,
.
$ tar tvzf package, tar.gz I less gzip-
$ tar tvjf package.tar.bz2 j less bzipl-
2.
,
.
$ mkdir newdir
$ cd newdir
$ tar xvzf package, tar . gz gzip-
50
http://itbookz.ru/

$ tar xvjf package, tar . bz2 bzip2-


3.

INSTALL README. , ,
.
$ cd newdir $ less INSTALL
4.
, INSTALL README
, configure
, make
make install. ,
configure.
$ ./configure --help
.
$ . /configure options
$ make
$ su -1
Password: ********
# make install

Is

mv
rm
In




("")

( )

,
Linux-, :
, , . .
Is [][]
coreutils
/bin
stdin stdout -file opt help version
Is ( " ")
.
:
$ Is
:
51
http://itbookz.ru/

$ Is dirl dir2 dir3


:
$ Is filel file2 file3
- - -1. Is
, ; -
. -1
- :
-rw-r-r--

I smith users 149 Oct 28 2002 my.data

: (-rw-r--
), (smith), (users), (149 )
(Oct 28 2002) .
" " 36
.

, ,

-l , .
-h ("human-readable" - ),
,

-F

,

.
"/" , "*"
, "@" , "|"
"=" - .
,

- i (inode)

- s ,
:
$ Is -s | sort -n
52
http://itbookz.ru/

-R

-d
, ,

[] ( \ )
coreutils
~/bin
stdin stdout -file -opt -help --versloti
:
$ filel file2
:
$ filel file2 file3 file4 dir
- -R,
.

,
, ,
, ( ,
, ,


)

,
, ,
. -R
( , ),
- () -d ()
i
.

f
(
)

53
http://itbookz.ru/

mv []
coreutils
/bin
stdin stdout -file --opt -help version
mv :
$ mv filel file2
:
$ mv filel file2 file3 file4 destination_directory 68

-i
-

. ,

f
(
)
rm [] \
/bin
stdin stdout -file opt --help -version

coreutils

rm :
$ rm filel file2 file3
:
$ rm - dirl dir2

-i
-

. ,

-
f
,

.
,
- f
54
http://itbookz.ru/

In []
/bin
stdin stdout -file -opt -help -version

coreutils

(link) - In
. .
, "" Windows
"" Macintosh.
$ In -s myfile softlink
,
, .
, -
( ,
).
.
$ In myfile hardlink
,
,
; ,
(inode)
.
, - ...
-d.

-s
-i
-f
-d

. -
. ,

( )

55
http://itbookz.ru/

,
(, linkname), .
$ readlink linkname $ Is -1 linkname

d
pwd


, . .

"
"
basename (. .
, )
dirname
(. .
,
)
mkdir

rmdir

rm r

Linux
" " 27.
, , ,
.
cd []

bash
stdin stdout -file --opt --help -version

cd ( )
. ,
cd
.
pwd

bash
stdin stdout -file --opt --help --version

pwd
.
56
http://itbookz.ru/

$ pwd
/users/smith/mydir
basename
coreutils
/bin
stdin stdout -file -opt help version
basename
; , , , ,
.
$ basename /users/smith/mydir
mydir
dirname
coreutils
/usr/bin
stdin stdout -file --opt help version
dirname
.
$ dirname /users/smith/mydir /users/smith
dirname ,
.
.
mkdir []
coreutils
/bin
stdin stdout -file opt help version
mkdir .
$ mkdir dl d2 d3

-p

(
),

.
,
- /one/two/three /one
/one/two, ,
/one/two/three

57
http://itbookz.ru/

-m

: $
mkdir -m 0755 mydir , umask
.
chmod
" " 95, " "
36.
rmdir[]
coreutils
/bin
stdin stdout -file --opt -help -version

rmdir ( )
, .
, (
) rm - . rm
-ri rm -rf
,
.

cat
less
head
tail
nl
od

E (
),
,
,
. rmdir -p /one/two/ three
/one/tmflhree,
/one/two /one,

)
xxd

58
http://itbookz.ru/

gv
xdvi

Postscript- PDF-
DVI-.

Linux
: , Postscript, .
, .
,
" " 246, - " " 251.
cat [] []
coreutils
/bin
stdin stdout -file --opt^help --version
cat,
,
( - - concatenate, ).
, , ,
,
less. , cat
.
cat ,
, (
nl ) .

-
-
-v
-n
-b
-s

"I
$






less [] []
less
/usr/bin
stdin stdout* -file opt -help version

59
http://itbookz.ru/

less .


.
$ command1 | command2 | command3 | command4 | less
less h
, .
.

h,
, f, ~V, AF
Enter
, , Esc-b
/

?
n
N
v

<
>
:n





.

Enter, less


/,







(
VISUAL, ,
,
EDITOR, ,
,
vi



60

http://itbookz.ru/

* less
, .

less ;
.
man-.

-
-m
-N
-r
-s
-s

,
( )

() ;
, less



head [] []
coreutils
/usr/bin
stdin stdout -file opt -help --version

head 10 :
.
$ head myfile
$ head * | less

-N
-n N
- N

N 10
N

61
http://itbookz.ru/

-q

" :

. head
,
tail [] []
coreutils
/usr/bin
stdin stdout -file --opt --help -version

tail 10 ,
.
$ tail myfile

-N
-n N
+N
- N
-f

-q

N 10

, /
^
,
, . .
- - retry, ,

" :

. tail

,
nl [] []
coreutils
usr/bin
stdin stdout -file -opt --help^-version

nl
, . ,
cat - -,
.
nl :

.
62
http://itbookz.ru/

-b [a|t|n|pR]

-v N
-i N

-n [ln|rn|rz]

-w N

-s S

(),
(t), ()
,
(
- )
iY(no
1)
'
, , ,
(-12)
(-v2 -i2) ( - 1)
(In), (rn)
(rz) (
- In)

( - 6)
5
( - TAB)

, nl
,
,
.
nl : \:\:\: (
), \:\: ( ) \: (
).
.
( man-),
.
od [] []
coreutils
/usr/bin
stdin stdout -file --opt --help --version
63
http://itbookz.ru/

,
od ( ).
, ASCII-,
, ,
, (byte, short, long).
, :
$ od -w8 /usr/bin/who
0000000
0000010
0000020
0000030

042577
000000
000002
106240

043114
000000
000003
004004

000401
000000
000001
000064

000001
000000
000000
000000

/usr/bin/who
, .
, ,
.

-N

-j
-w [ ]

-s []

5 ,
, (
) , 512 ( ),
( ) (
).
(5+1 )- ;
, -N.
0-
;
, -N. -w
-w32.
16

5, ; ,
-N. -s
- s 3.
2
64
http://itbookz.ru/

-A (d|o|x|n)
(d),
(), (h)
(). -
-1 ( | ) [ z ] ,
ESC (), ().
z
-t (d| |u | ) [SizElz] ] ,
(), (d),
(), () (

xxd). ^^
;
, , S, I L,
char,
short, int long .
z .
-1 f [ SIZE [ z ] ]

. 5/7
;
, F, D
float, double long
double . z
. -1 ,
-to2. z
-t, ,

,
xxd
xxd [] []
vim-common
/usr/bin
stdin stdout -file --opt -help -version

od,
xxd

.
,
65
http://itbookz.ru/

- .
, :
$ xxd /usr/bin/who
0000000: 7f45 4c46 0101 0100 0000 0000
0000 0000 .ELF
0000010: 0200 0300 0100 0000 08 0408
3400 0000
4. . .
0000020: 6824 0000 0000 0000 3400 2000
0600 2800 h$ 4. . . . (.
0000030: 1900 1800 0600 0000 3400 0000
3480 0408
4. . .4. . .

/usr/bin/who, 16 .
,
,
, .
xxd
:

(
).

-iN

-sN
- s -N

- N
-g N

(
)
.

N . (-N) /
( +#
;
man-)
/ (
16 )
N ,
, od -s (no
2 )
66
http://itbookz.ru/

-b
-u
-
-i

-r

,


,

, 60

.
unsigned chars,
, unsigned int,
.


:
xxd
.
, , .
,
,
:
$ xxd myfile | xxd -r
$ xxd -p myfile | xxd - -p
gv []
/usr/X11R6/bin

gv
stdin stdout -file --opt --help --version

GhostView Adobe Postscript- PDF .


gv ghostview.
: , .
.
GhostView - Postscript Linux,
PDF-,
acroread (http://www.adobe.com/) xpdf
67
http://itbookz.ru/

(http:// www.foolabs.com/xpdf/).

-page P
-monochrome
-grayscale
-color
-portrai t
- landscape
-seascape
-upsidedown
-scale N

-watch
-nowatch
(nowatch)

- ( 1-)
:,


; ,
gv

.
( )
().
Postscript-
(watch),

xdvi [] tetex-xdvi
/usr/bin
stdin stdout -file --opt -help -version

DVI, .dvi.
xdvi DVI- .
DVI- Postscript-
dvips,
GhostView (gv) :
$ dvips - myfile.ps myfile.dvi
$ gv myfile.ps
xdvi
, , Next
( ) (
, xdvi -expert).
.
68
http://itbookz.ru/


q
n, , Enter, Pagedown

, Backspace, Delete, Pageup

<
>
^L
R

.
N,
N

.
N,
N




DVI-, ,
,

xdvi
, ,
.


emacs
vim
umask
soffice
abiword

Free Software Foundation


, Unix vi


Microsoft Word, Excel PowerPoint
Microsoft Word gnumeric
Excel

Linux,
. -
emacs Free Software Foundation vim, Unix vi.
69
http://itbookz.ru/

, online-cnpa-
, . 1.
myfile,
.
$ emacs myfile
$ vim myfile
myfile ,
. (
), touch (
" " 95):
$ touch newfile
,
-
( " /"
47):
$ echo

> newfile

, Microsoft
Windows-, Linux-,
Microsoft Word, Excel
PowerPoint.

Linux
,
vim. ,
,
less , "v". ,
, vim
(. . )?
VISUAL EDITOR ,
, .
$ EDITOR=emacs
70
http://itbookz.ru/

$ VISUAL=emacs
$ export EDITOR VISUAL

,
, .
EDITOR VISUAL
~/.bash_profile, ,
.
,
.
, ,

vim emacs , -

.
emacs [] []
emacs
/usr/bin
stdin stdout -file --opt -help --version
emacs -
, ,
,
.
emacs, :
$ emacs
^h t.
emacs
CTRL (, "F)
, , Alt.
emacs
- (, M-F " ,
, F"), .
. 1.
vim [] []
vim-enhanced
/usr/bin
stdin stdout -file -opt -help -version
71
http://itbookz.ru/

vim -
Unix- vi. vim,
:
$ vimtutor
vim : (insert)
(normal).
,
, " "
/.
. 1.
1.
emacs vim
1. emacs
vim

Emacs

vim

text
!

$ emacs -nw [file]

$ vim [file]

$ emacs [file]

$ gvim [file]

Text
^x^s ^x^c
^x^c ""


^x^s
^x^w
^_

i text ESC
:wq
:q!

^z

(N/A)

ESC

:w
: w_
u
z

72
http://itbookz.ru/

^q

ESC

^f
^b

1
h

1.
emacs vim ()

emacs
vim
^
r

- f

j
w

-b

0
$
^
f

^
v


M-v


-<

->

gg

Backspace

M-d

de

73
http://itbookz.ru/

M-Backspace

^ ^ ^

akk

dd

^

(
,
,

)

db

d$
^

1.
emacs vim ()

emacs vim

^w

M-w

^h

:help

^h i

:help

umask [] []
bash
stdin stdout -file --opt --help --version
umask
.
, ,
(
" " 36 ,
chmod, " "
95).
74
http://itbookz.ru/

$ umask
0002
" "' '" '
$ umask -S
u=rwx,g=rwx,o=rx
. umask -
, . . , (
XOR) 0777
,
. , 0002 XOR 0666 0664
, 0002 XOR 0777 - 0775 .
, .
0022, ,
- /.
$ umask 0022
$ touch newfile && mkdir dir
$ Is -Id newfile dir
-rw-r--r 1 smith smith 0 Nov 11 12:25 newfile
drwxr-xr-x 2 smith smith 4096 Nov 11 12:25 dir
,
/, 0
002.
$ umask 0002
$ touch newfile && mkdir dir
$ Is -Id newfile dir
-rw-rw-r-- 1 smith smith
0 Nov 11 12:26 newfile
drwxrwxr-x 2 smith smith 4096 Nov 11 12:26 dir
,
, 0077.
$ umask 0077
$ touch newfile && mkdir dir
$ Is -Id newfile dir
-rw
1 smith smith
0 Nov 11 12:27 newfile
75
http://itbookz.ru/

drwx

2 smith smith 4096 Nov 11 12:27 dir

soffice []
openoffice.org
/usr/lib/openoffice/programs stdin stdout -file -opt --help -version

OpenOffice.org* -
,
Microsoft Word, Excel PowerPoint.
:
$ soffice
.
t.
, .
OpenOffice.org
( sdraw), (sfax), (slabel), . .
http:/ /www.openoffice.org/
, Help
soffice.
abiword [][\ abiword
/usr/bin stdin stdout -file --opt --help --version

abiword -
Microsoft Word. soffice,
,
. ,
: abiword
.
* "org" - .
t soffice Writer ( swr i
ter) , Calc (scale)
impress (simpress) ,
.

gnumeric [][/\ gnumeric


/usr/bin stdin stdout -file --opt help version

76
http://itbookz.ru/

gnumeric -
, Microsoft
Excel. ,
Excel, gnumeric .
,
: gnumeric .


stat
we
du


, , ,
,

file
( )
touch
chown ~
chgrp

chmod
chattr

Isattr

Linux -
. , ,
, , ,
. Is -1 (. "
" 66)
,
.
stat [] coreutils
/usr/bin stdin stdout -file --opt -help -version

(
) ( -f).
:
$ stat myfile
File: "myfile"
77
http://itbookz.ru/

Size: 1264 Blocks: 8 Regular File


Access: (0644/-rw-r--r--) Uid: ( 600/smith)
Gid: ( 620/users)
Device: 3 0a
Inode: 99492
Links: 1
Access: Fri Aug 29 00:16:12 2003
Modify: Wed Jul 23 23:09:41 2003
Change: Wed Jul 23 23:11:48 2003
(myfile),
(1264), (8), (Regular File),
(0644), "Is -I" (-rwr--r--), (600), (smith),
(620), (users),
(30), (99492),
(1) ,
(, ).
:
$ stat -f myfileb
File: "myfile"
ID: bffff358 ffffffff Namelen: 255 Type: EXT2
Blocks: Total: 2016068
Free: 876122
Available: 773709 Size: 4096
Inodes: Total: 1026144 Free: 912372
(myfile), -
(bffff358 ffffffff),
(255 ),
(2), ,
(2016068, 876122,
773709 ),
(4096),

(1026144 912372 ).
-t ,
, .
shell- .
$ stat -t myfile
78
http://itbookz.ru/

myfile 1264 8 81a4 500 500 30a 99492 1 44


le 1062130572 1059016181 1059016308
$ stat -tf myfile
myfile bffff358 ffffffff 255 ef53 2016068
875984 773571 4096 1026144 912372

-l
-f
-t


,
,
,
:

we [] [] coreutils
/usr/bin stdin stdout -file -opt -help --version

we ( . word count) ,
( ) .
$ we myfile
24
62

428 myfile

24 , 62 , ,
428 .

-l
-w
-
-L

.

()

du [] [\ ] coreutils
/usr/bin stdin stdout -file -opt -help -version

du ( . disk usage)
, .
, ,
79
http://itbookz.ru/

,
.
$ du
8./Notes
36
./Mail
340
./Files/mine
40
./Files/bob
416
./Files
216
. /PC
2404
.
$ du file file2
4./file
16
./file2

-b -k -m
- N
-h -H

-L


(-), (-)
(-)
, 1 =
N ( 1 = 1024)


. ,
1 25
, du -h 1G 25.
-h 1024, -
1000
.

,
-,

,

80
http://itbookz.ru/

-s


file [] file
/usr/bin stdin stdout -file --opt -help version

file .
$ file /etc/hosts /usr/bin/who letter.doc
/etc/hosts:
ASCII text
/usr/bin/who: ELF 32-bit LSB executable, Intel 803 86 ...
letter.doc:
Microsoft Office Document
Linux
, , .

-b

(
)
-i
MIME- , , "text/plain"
"audio/mpeg", .
-f name_file , ,
name_file ( ),
,
,
-L
,
,
-z
(. "
" 134),
, ,
1, "
"
touch []
coreutils
/bin
stdin stdout -file -opt -help -version

touch ,
: (
) ,
( ).
81
http://itbookz.ru/

$ touch myfile
,
.
$ touch -d "November 18 1975" myfile
, touch , .
. .

-
-m
-

-d _

-t _



,
( touch
)
_()
.
,
, "12/28/2001 ", "28-"
(
00.00), "next tuesday 13:59", "0" (
).

stat.


info touch

,
[[CC]YY]MMDDhhmm[.ss],
- , ,
YY - , ,
- , , DD
, , hh
, , mm -
, , ss -
82

http://itbookz.ru/

, . , -t
20030812150047 August 12,2003,
at 15:00:47
chovn [\ user spec
/bin
stdin stdout -file --opt -help -version

coreutils

chown ( . change ownership)


.
$ chown smith myfile myfile2 mydir
user_spec
:
( )
;
( ),
(
), ;
( ),
,
;
( ),
, ;
--ref erence=file

, //.

- -dereference
-R

chgrp [] user spec


coreutils
/bin
stdin stdout -file opt help version

chgrp ( . change group)


.
83
http://itbookz.ru/

$ chgrp smith myfile myfile2 my_dir


groupspec
:
;
--ref=//
, file.
" " 190
.

--dereference
-R

chmod []
coreutils
/bin
stdin stdout -file --opt -help -version
chmod ( . change mode)
.
( Windows 95), chmod -
, .
, ,
, , /
.
:
reference=/i/e , file;
, ,
.
( ), ,
,
. . 3
, 0640;
,
(. .

), .
84
http://itbookz.ru/

. .
:
, .
()
u , g , -(
4), - .
- .

"+" - , "-" - , "=" -


, .

r - , w - /, - (
cd
), X - (
), - , g -
, - " ", s setuid setgid, t -
(sticky bit).
85
http://itbookz.ru/

, ug+rw
, - ( -)
, u=r

. ,
ug+rw, -.
setuid setgid
( ). ,
F "smith" "friends".
F setuid ( . set user ID), ,
F, "" smith,
, .
, F setgid ( . set
group ID), , F,
friends . ,
setuid setgid ,
, ,
. chmod +s
.
(X) ,
, ,
,
. .


-R

chattr [[ [+ -=\[1[ []
e2fsprogs
/usr/bin
stdin stdout -file --opt -help -version
Unix-, , ,
, Linux
.
ext2 ext3 ( Fedora),
chattr (
86
http://itbookz.ru/

. change attribute)
lsattr.
chmod,
(+) (-) ,
(=).

, . .

- .


:
(atime)

:

d
: dump

(. "
" 154)
i
:
( )
j
(
)
s
:

s
:
,
sync (.
" "
146)
u
:


-R

lsattr [] []
e2fsprogs
/usr/bin
sldin stdout -file opt help --version
87
http://itbookz.ru/


chattr,
lsattr ( . list attributes).
, chattr; ,
.
$ lsattr myfile
-u--i
myfile - .,

-R
-


, ,

,
.
, lsattr
.

-d

find
slocate
which
type

whereis




()

( bash)
,

Linux-
. , ?
-
,
,
, .
find,

. slocate ,
88
http://itbookz.ru/

,
(Fedora
).
which type
.
type bash (, ,
bash), which
( /usr-/bin/which); type
* .
, whereis
, .
find [] []
findutils
/usr/bin
stdin stdout -file -opt --help -version
find (
) ,
. , 50
, , .
,
.
myfile.
$ find / -type f -name myfile -print
.
$ find / -type d -print
tcsh
, which .

-name
-path
-lname
-iname
-ipath
-ilname

(-name), (-path)
(-lname)

,
*, ?, [].
,
. -iname, -ipath and

89
http://itbookz.ru/

i lname -name, -path -lname


,
-regex regexp

( ,
)

regexp

-type
f|d|l|b|c|p|s

(f),
(d), (1),
(), (),
() (s)

atime N
ctime N
mtime N


(-atime),
(-mtime) (- ctime)
N*24 . +/VB
" N" -NB " N1

amin N
cmin N
irani n N


(- amin),
(-mmin) (-cmin)
. -'
" /V, -/VB "

-anewer other_f ile


-cnewer other_file
-newer other_fiie

(-anewer),
(-newer)
(-cnewer) ,
other_f

-maxdepth N
-mindepth N

(-mindepth)
(-maxdepth) /
,


:

() ,

- f 11 ow
-depth

90
http://itbookz.ru/

-xdev
-size N[bckw]

-empty
-user
-group
-perm
-perm -
-perm +

, .
.
N,
(), (),
() (w).
+/ " /V', -N
" N'





, .
- ,
, ,
+, ,


.
I - !
"" ( ,
, "-"
).
1 - ! "".
/ -not ()
, .
.
"\".
! , 2
91
http://itbookz.ru/

,
. .
, ,
find ,
.

-print

-printf
,
, printf ().
man
-printo
-print,

(ASCII 0). ,
find
,
. ,

, , xargs -0
-exec cmd ; ,
cmd.
-ok cmd ;

,
,
. , "{}" (
)
.
- ok
; -exec
-Is
Is -dils
find,
, xargs,

(. man xargs). ,
92
http://itbookz.ru/

,
.

"myxomatosis",

$ find . -printO | xargs -0 grep myxomatosis


slocate []
slocate
/usr/bin
stdin stdout -file --opt --help -version
slocate ( ) (
)
.
, , slocate
.

find.
Fedora Linux
,
(, /tmp/myindex),
.
$ slocate -u - /tmp/myindex

, .
$ slocate -U directory - /tmp/myindex
, string ,
.
$ slocate -d /tmp/myindex string
slocate ""?
, , ,
. ,
, ,
, .
93
http://itbookz.ru/


-u
,
-u
,
-1 (0 11)
(0) (1) .
1
-
.

- _ _

-d
,
( /tmp/myinde^
-I
,
-r _ ,
_
which
which
/usr/bin
stdin stdout -file opt -help --version
which
.
, :
$ who

:

which

$ which who
/usr/bin/who
which.
$ which which a _ti
/usr/bin/which

94
http://itbookz.ru/


(, /usr/bin/who /usr/local/ bin/who), which
.
type []
bash
stdin stdout -file opt --help -version
type, which,
.
$ type grep who
grep is /bin/grep
who is /usr/bin/who
type
, which - .
$ type which type rm if
which is /usr/bin/which
type is a shell builtin
rm is aliased to /bin/rm'
if is a shell keyword
type ,
which; ,
bash.
whereis []
util-linux
/usr/bin
stdin stdout -file --opt --help --version
whereis
.
, .
whereis ,
.

-b
95

http://itbookz.ru/

-m
(-b), -(-m)
-s
(-s)
- .. . -f . .. (-), man- ... -f . . . (-),
-S ... -f . .. (-S)
.
- f ,
,

grep

,

cut

paste

tr

sort


uniq

tee


Linux - :
( )
. ,

, ,
.
grep [] []
grep
/bin
stdin stdout -file opt help version
grep -
Linux. :
, ,
.
, myfile :
The quick brown fox jumped over the lazy dogs!
96
http://itbookz.ru/

My very eager mother just served us nine pancakes.


Film at eleven.
, "pancake",
:
$ grep pancake myfile
My very eager mother just served us nine pancakes.
grep
: . ,
, , ,
grep.
. 2 3.
-v
-l
-L
-
-n
-b

-i
-w
-

,
/
,

,
,




,
,

,
,


,
(. .
,
)
(. .

97
http://itbookz.ru/

,
).
-w

N

N
, - N - N: N (
) ,




(. egrep)

(. f grep)

- N
- N
-N
-r
-
-F

eg rep [] [] grep
/bin stdin stdout -file --opt -help -version
egrep grep,
("") .
grep -E.
2.
grep

.
[. . .]
[^. ..]
(...)
^
$
\<
\>





98
http://itbookz.ru/

[:alnum:]
[:alpha:]
[:cntrl:]
[:digit:]
[:graph:]
[:lower:]
[:print:]
[:punct:]
[:space:]
[:upper:]

2.
grep ()

[ :xdigit: ]

*

\
"", ""

.
, \*
\\
.
, , [*] [\]
3. :


\|
|

\+
+


\?
?


\ {n\}
{n}


\{n,\}
{n, }
n

99
http://itbookz.ru/

\{n,m\}

{n,m}

n m ()

, n < m.

fgrep [] [ ] []
/bin
stdin stdout -file --opt -help -version

gr

fgrep grep,
,
.
grep -F. , one, two
three myfile:
.
$ f grep ' one
,

two
three' myfile
fgrep, , -f,
. ,
:
$ cat my_dictionary_file
aardvark
aback
abandon
...

:
$ fgrep -f my_dictionary_file *
fgrep ,
, * {,
,
.
100
http://itbookz.ru/

cut -(b | | f) [] [] coreutils


/usr/bin
stdin stdout -file --opt -help -version
cut .
(,
):
$ cut -cl9 myfile
(
, ,
):
$ cut -b19 myfile
(,
):
$ cut -d,

-f5 myfile

:
(3-16),
(3,4,5,6,8,16) , (3,4,8-16).
, (-16),
(1-16);
(5-), .

-de


-1

--output-delimiter=C

-1

-s
( ) ,

101
http://itbookz.ru/

paste [] []
coreutils
/usr/bin
stdin stdout -file opt help version
paste - cut:
,
:
$ cat letters

$ cat numbers
1
2
3
4
5
$ paste numbers letters
1
A
2

4
5
$ paste letters numbers
A
1

3
4
5

-d


;
.
(- d:),
,
(-dxyz),

102

http://itbookz.ru/

-s

( - , - , z, - , - ,...)

: $ paste -s letters numbers
ABC
12 3 4 5

tr [[ _1 [_2] coreutils
/usr/bin
stdin stdout -file -opt --help --version
tr
. ,
, .
$ cat myfile
This is a very wonderful file.
$ cat myfile | tr aeiouAEIOU '*'
Th*s *s * v*ry w*nd*rf*l f*l*.
,
$ cat myfile | tr -d aeiouAEIOU
Ths s vry wndrfl fl.
,
:
$ cat myfile | tr 'a-z' 'A-Z'
THIS IS A VERY WONDERFUL FILE.
tr _ ]
_2, - , -
, . . _1 N ,
N ^ 2 (,
J _2,
-t).
.
103
http://itbookz.ru/


ABCD
-
[*]
[: class:]

, , , D


([: alnum: ], [: digit:],
. .), grep

tr escape-: "\" ("G


= ), "\" ( = ), "\ ( = ), "\" ( J =
), "\" ( = ), "\t" ("I = ) "\v"
( = ), print f (.
" " 224), \
.
tr ;
sed,
awk perl.

-d
-s

-
-l

_ 1

( ^
1) . , t r s aeiouAElOU
( reeeeeeally really)
, ^ !
/ 2,
_ 1.
-1 , '
2'() ,
_2 ,
2

sort [] []
coreutils
/bin
stdin stdout -file opt -help -version
sort
- ,
. ,
.
104
http://itbookz.ru/

$ cat myfile
def
xyz
abc
$ sort myfile
abc
def
xyz


-f
-n

,
(. . 9
10), ( 10
9,
"1")
-g

, ,
,
(, 7.4,
"7.4
" 7400). info sort,

-u
:
(
-
,
)
-
, ,
.
, ,

-b

-r
( )
-t X

-
- F1 [. 1 ] [, F2 [. 2] ]
105
http://itbookz.ru/

- ,
, .
, " ". sort
, :
aaaaz
bbbby
- "
", ,
"" "z". .

F1
1
F2
2

1

1

sort -kl. 5
, ; sort -k2.8,5
"
".
- ,
,
, .
uniq [] []
coreutils
/usr/bin
stdin stdout -file --opt -help version
uniq
. , file:
$ cat myfile

b
b

106
http://itbookz.ru/

b
uniq (, )
b, b.
$ uniq myfile
a
b
unig .
$ sort myfile | uniq
a
b

.
, .
$ sort myfile | uniq
1a
3b
1c

-
-i
-u
-d
-s N
-f N
-w N




/^

/

^
.
s - f sort
,

107
http://itbookz.ru/

N
iee []
coreutils
/usr/bin
stdin stdout -file --opt --help --version
cat, tee
. ,

, tee
,

.
$ who | tee original_who | sort

who ,
() who
original who.


-
-i


Linux. ,
.
,
. .
awk
awk - .

.
myfile.
108
http://itbookz.ru/

.
$ awk '{print $2, $4}' myfile
60 .
$ awk '{length($0) < 60}' myfile
sed
awk, sed - ,
.
vim ed.
.
, "red"
"hat".
$ sed 's/red/hat/g' myfile
, 10 .
$ sed 'l,10d' myfile
m4
m4 - .
. , :
$ cat myfile
My name is NAME and I am AGE years old
ifelse(QUOTE,yes,No matter where you
go... there you are)
m4 NAME, AGE QUOTE.
$ m4 -DNAME=Sandy myfile
My name is Sandy and I am AGE years old
$ m4 -DNAME=Sandy -DAGE=25 myfile
My name is Sandy and I am 25 years old
$ m4 -DNAME=Sandy -DAGE=25 -DQUOTE=yes myfile
109
http://itbookz.ru/

My name is Sandy and I am 25 years old


No matter where you go... there you are
perl, python
Perl Python - ,
,
.

gzip
gunzip
compress
uncompress
zcat
bzip2
bunzip2
zip
unzip
uuencode
uudecode

GNU Zip
GNU Zip !
Unix
Unix
/
/ (gzip compress)
BZip
BZip
Windows Zip
Windows Zip
uuencode
uuencode

Linux
. -GNU Zip (gzip),
.gz.
- Unix ( . z), bzip2- (
.bz2) Zip- Windows- ( . zip).

, ()
.
MIME, uuencode
uudecode, .
, ,
Macintosh hqx/sit, Arc, Zoo ,

http://www.faqs.org/faqs/compression-faq/partl7section-2.html

http://www-lO6.ibm.com/de-velopenvorks/library/1-lw-comp.html.
110
http://itbookz.ru/

gzip [] [/\
'
gzip
stdin stdout -file --opt -help --version
gzip gunzip
GNU Zip. .gz.

gzip file

file file. gz.

gzip - file


cat file | gzip

gunzip file.gz
file.gz .
file.gz
gunzip - file.gz

cat file.gz | gunzip
zcat file.z

tar-, gzip:
tar czf myf ile. tar .gz dirname
dimame
tar tzf myf ile. tar .gz

tar xzf myf ile. tar .gz

v tar,
.
compress [] []
ncompress
/usr/bin
stdin stdout -file -opt -help -version
compress uncompress
Unix (Lempel Ziv).
.Z.

compress file

compress - file

fi 1 fi 1 . Z.


111
http://itbookz.ru/

cat file | compress


uncompress file.Z


fi 1 e. Z fi 1 e.
*/.7

uncompress - file.Z
cat file.Z |
uncompress
zcat file.Z

tar-, compress:
tar czf myfile.tar.z mydir
tar tzf myfile.tar.z
tar xzf myfile.tar.z

mydir

v tar,
.
bzip2 [] [/\ bzip2
/usr/bin
stdin stdout -file -opt -help -version
bzip2 bunzip2
Burrows-Wheeler. .bz2.
bzip2 file bzip2 - file cat file | bzip2 bunzip2 file.bz2 bunzip2 -c
file.bz2


bunzip2 file
bunzip2 c file
cat file.| bzip2
bunzip2 file.bz2

ff/ e.bz2.



.2 Hie.
/?.?
112
http://itbookz.ru/

bunzip2 c file.bz2
cat file.bz2| bunzip2
bzcat file.bz2

tar-, bzip2:
tar cjf myf ile. tar .bz2 dirname

tar tjf -myf ile. tar .bz2



tar xjf myf ile. tar .bz2

v tar,
.
zip [] []
zip
/usr/bin
stdin stdout -file --opt --help --version
zip unzip
Windows Zip. .zip.
gzip, compress bzip2, zip
().
zipmyfile.zip filel file2 file3. ..
zip -r myfile.zip dirname
unzip -I myfile.zip
unzip myfile.zip

uuencode [] shamb\s
/usr/bin
stdin stdout -file -opt --help --version

MIME,
, .
uuencode ASCII-,
.
begin 644 myfile
M(R4N8F%S:%]P<F]F:6QE"B,@4G5N<R!F:
7)S="!W:&5N(&QO9V=I;F<@:6X6
- M=6YD97(@1TY/344*"G1R874@)
PH@('1E<WO@+6X@(134?04=%1?4$$
end
113
http://itbookz.ru/


uudecode,
.
myfile uuencode, .
. myfile.uu .
$ uuencode newfile myfile > myfile.uu
, newfile, - ,
.
.
begin 644 newfile
M(R~N8F%S:%]P<F]F:6QE"B,@4G5N<R!F:7)S="!W:
&5N(&QO9V=I;F<@:6X@
myfile.uu, newfile,
.
$ uudecode myfile.uu


diff
comm

md5sum




(MD5)

Linux:
(dif f, dif f3, sdif f, comm),
;
(),
;
(md5sum, sum, cksum).

.
- xxdif f,
http://xxdiff.sourceforge.net.
114
http://itbookz.ru/

diff [] 1 2
diffutils
/usr/bin
stdin stdout -file opt --help -version
diff ,
. , diff
.
diff , . ,
diff ; .

.
.

< file 1,
> fde2, ,
/z/e_a.
Hello, this is a wonderful file.
The quick brown fox jumped over
the lazy dogs.
Goodbye for now.
, ,
"brown" "blue" ,
filejb.
The quick blue fox jumped over
the lazy dogs.
Goodbye for now.
Linux rOOlz!
diff file_a f ile_b
.
1, 2cl 1-2 filea I file_b
<Hello, this is a wonderful file.
1-2 file_a
<The quick brown fox jumped over
diff
>The quick blue fox jumped over
1 filejb
115
http://itbookz.ru/

4a4
4
>Linux rOOlz !
< > - ,
filea file_b . :
,
. ,
, .


-n
RCS,
re sdif f (man rcsdif f)
-
di f f,
patch (man patch)
-D macro

#ifdef macro... #else ... tendif
-u
,
"-" "+"
-
; -W

-
ed-,
file file b
-q
,

diff .
:
$ diff dirl dir2

, ,
, .
, , -:
$ diff - dirl dir2

116

http://itbookz.ru/

-b
-
-i
-r

diff- ,
. : dif f 3,
, sdif f,

.
comm [\ 1 2
coreutils
/usr/bin
stdin stdout -file opt help version
comm
, .
1.
, file],
file2.
2.
, file2,
file 1.
.
, .
, file J file2 :
filel:
apple
baker
charlie

file2:
baker
charlie
dark

comm :
$ comm filel file2 apple
baker
charlie dark

117
http://itbookz.ru/


-1
-2
-3

1
2
3

cmp [] 1 2[1 [2\] diffutils


/usr/bin
stdin stdout -file --opt -help -version
cmp .
, cmp , ,
.
.
$ cmp myfile yourfile
myfile yourfile differ: char 494, line 17
, cmp ,
, , .
, diff,
.
, cmp
, ,
.
$ cmp myfile yourfile 10 20
myfile
yourfile.


-1

-s

: :
$ cmp -I myfile yourfile
494 164 172
, , 494 (
) , myfile
"t" (164 ),
yourfile - "z" (172 )
: ,
118
http://itbookz.ru/

; 0,
, 1 - (
, )
md5sum | --check coreutils
/usr/bin
stdin stdout -file opt -help version
md5sum 32-
, MD5 (
http:// www.faqs.org/rfcs/rfc 1321 .html).
$ md5sum myfile
dd63 602dflcceb57 96 6d085524c3 980f
myfile

MD5,
-
:
$ md5sum myfilel > suml
$ md5sum myfile2 > sum2
$ diff -q suml sum2
Files suml and sum2 differ
suml sum2
,
--check:
$ md5sum filel file2 file3 > mysum
$ md5sum --check mysum
filel: OK
':
file2: OK
f ile3 : OK ',..-.
$ echo " " > file2
$ md5sum --check mysum
filel: OK
file2: FAILED
file3 : OK
.. . .
119
http://itbookz.ru/

md5sum: WARNING: 1 of 3 computed . checksums did NOT


match : I 3
, md5sum, - sum
cksum,
. sum Unix, BSD Unix ( ) System V Unix
( -s), a cksum CRC.
$ sum myfile
12410 3
$ sum -s myfile
47909 6 myfile
$ cksum myfile
1204834076 2863 myfile
- , . , ,
, , ,

. md5sum .

Df

mount
umount
fsck
sync



( )
( )

Linux-
. -: ,
, , , .
.
- ,
,
. Linux-
, /dev. ,
/dev/hda7 IDE master120
http://itbookz.ru/

. /dev
.
hda
IDE-, master-;
Mai, hda2,...
hdb
IDE-, slave-;
*1,2,...
hdc
IDE-, master-;
\/1,2,...
hdd
IDE-, slave-;
2
sda
SCSI-;
sda1, sda2,...
sdb
SCSI-;
sdbi, sdb2,... sdc, sdd,...
htO
IDE( htl, ht2,...)

( nht1, nht2,...)

stO
sti, st2,...)
scdO
SCSI CD-ROM ( scd1, scd2,...)
fdO
- ( fdl, fd2,...),
, /mnt/floppy
,
"" .
, ;
- ext3 (
Linux, Fedora) vfat ( Microsoft
Windows). , ,
Linux.
,
, . ,
Windows /mnt/win,
,
, , ,
/mnt/win/myfile. ,
, , .
121
http://itbookz.ru/

,
.

df [] [ // ]
/bin stdin stdout -file --opt -help -version

coreutils

df ( . disk free) ,

. , df
,
. df
.
$ df
Filesystem Ik-blocks Used Available Use% Mounted on
/dev/hda 1011928 225464 735060 24%/ /dev/hda9 521748
249148 246096 51%/var /dev/hda8 8064272 4088636 3565984 54%/usr
/dev/hdalO 8064272 4586576 3068044 60%/home

-
-m
- N
-h

()

, ,
1 = ' ( 1 = 1024 )

-
.

, 1 25
, df -h
1G 25. -h 1024,
- - 1000
-1

,
-m

(12, vfat . .)
-1


122
http://itbookz.ru/

-
-i



lnode-. ,

(i-node)

mount []
mount
/bin
stdin stdout -file -opt --help -version
mount
.
(, /dev/hda/),
(, /mnt/mydir).
#mkdir /mnt/mydir
#mount /dev/hdal /mnt/mydir
#df /mnt/mydir
Filesystem lK-blocks Used Available Use% Mounted on
/dev/hdal 1011928 285744 674780 30% /mnt/mydir
mount ;
.
mount
/etc/fstab ( ), ,
. , mount /usr,
mount "/usr" /etc/fstab,
, , .
/dev/hda8

/usr

ext3

defaults

mount , ,
/dev/hda8 /usr
ext3*.
, mount ,
, - CD-ROM,
.
123
http://itbookz.ru/

$ mount /mnt/cdrom
$ mount /rant/floppy
* -t mount
, , mount -t
ext3 /dev/hdal /mnt/mydir. , man
mount.

umount [] [ \ ] mount
/bin
stdin stdout -file --opt -help -version
umount - mount:
. , CDROM, ,
umount.
$ umount /mnt/cdrom

,
.
, .
# umount -a
,
; , umount
.
fsck [] [^
e2fsprogs
/sbin stdin stdout -file --opt --help --version
fsck ( . filesystem check)
Linux- , , .
fsck ;
, .
, , ,

.
124
http://itbookz.ru/

#umount /dev/hdalO
#fsck -f /dev/hdalO
Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking
directory structure Pass 3: Checking directory connectivity Pass 4:
Checking reference counts Pass 5:
Checking group summary
information /home:
172/1281696
files
(11.6% noncontiguous) ,
1405555/2562359 blocks
fsck -
/ sbin ,
"fsck".
;
.
$ Is /sbin/fsck.* | cut -d. -f2
fc."

, /etc/fstab,
no
, ,
,
,

(
, ;
)

-N
-r
-

sync
/bin

coreutils
stdin stdout -file -opt --help --version

sync
.
, ,
. sync .
, , ()
- ,
125
http://itbookz.ru/

,
sync.

, ,
Linux-. , ,
, (
man-).
parted, fdisk
( ) .
s fdisk
:

mkf s
, . .

f I oppy

mt
dump
restore
tar
cdrecord
rsync



dump

CD-R-


Linux:
;
CD-R-;
.
,
/dev/htO, IDE
/dev/stO SCSI ( IDE ide-scsi-).
- /dev/tape
.
126
http://itbookz.ru/

$ In -s /dev/htO /dev/tape
Linux
. cpio tar,
dd.
man- , .
mt
mt-st
/bin
stdin stdout -file -opt -help --version
mt ( . magnetic tape)
,
, .
.
status

rewind

retension
(
)
erase

f f I ine

eod

:
$ mt -f /dev/tape rewind
,
, , ,
/, , tar restore.
dump []
dump
/bin
stdin stdout -file --opt --help --version
dump ,
, , .
,
, (. .
).
127
http://itbookz.ru/

,
restore.

(, /usr)
(, /dev/tape), -0 () -.
#dump -0 -u -f /dev/tape /usr
. -
/etc/dumpdates, ,
.
1 9
: i-
(il)-ro .
#dump -I -u -f /dev/tape /usr
He dump "" ,
:
.
restore [] [] -- dump
/sbin stdin stdout -file --opt --help --version
restore (),
dump. ,
.
restore - -i
, ,
,
, , .
# restore -i -f /dev/tape
restore .
help
quit



128
http://itbookz.ru/

cd

Is
pwd
add

add _
delete

delete _
extract.

cd
,

Linux- Is,


pwd
,

"
" - ,
.
add



add

add:
.
delete
(
)

delete

,
(:

,
)

restore ,
, .
res tore -x


129
http://itbookz.ru/

restore r

res tore -t
restore

(

)

(

)

tar [] [/\
tar
/bin
stdin stdout -file --opt -help -version
tar ( . tape archive)
:
$ tar -cf /dev/tape myfilel myfile2
tar-,
Linux- Unix-,
.
$ tar -czvf my_archive.tar. gz mydir
$ tar -tzvf my_archive.tar.gz

$ tar -xzvf my_archive.tar.gz

,
.
$ tar -xvf /dev/tape filel file2 file3
.

-
-r

.


130
http://itbookz.ru/

-u
-

/
(, tar-)
: , tar -A -f /dev/tape myfile.tar
-1

-

-f
, .
(,
/dev/tape) ,
tar- Linux
-d

-z
( ) ( )
...
gzip
-j
( ) ( )
bz ip2
-z
( ) ( )
compress
-b
N
'* 512
-v
:
-h

-1

-


cdrecord []
cdrecord
/usr/bin
stdin stdout -file --opt -help -version
cdrecord CD-R- SCSI- IDE, ide-scsi .

CD-ROM, Linux-, Windows-
Macintosh-*.
1.
-
, .
$ cdrecord --scanbus
0,0,0
0,1,0

0) *
1) *

131
http://itbookz.ru/

0,2,0
2) *
0,3,0
3) 'YAMAHA ''CRW6416S
Removable CD-ROM
-.*;? -.

''l.Od1

0,3,0.
2.
CD-R- CD-RW- (
, )
. , 6-
CD-R-, 6.
3. , , ,
, dir. ,
-. dir
-, .
4. -:
$ DEVICE="0,3,0"
$ SPEED=6
$ mkisofs -R -1 dir > mydisk.iso
$ cdrecord -v dev=${DEVICE}
speed=${SPEED} mydisk.iso
* , - ISO9660 Rock Ridge.
mkisofs ,
cdrecord: , man mkisofs.

, ,
:
$ mkisofs -R -1 dir \
| cdrecord -v dev=${DEVICE}
speed=${SPEED} cdrecord
-, , ,
- , xcdroast
(. " " 251),
cdrecord.
132
http://itbookz.ru/

rsync [] rsync
/usr/bin
stdin stdout -file opt help version
rsync .
, (
),
.
. rsync
50 ;
,
.
dirl
dir2 ,
.
$ rsync -a dirl dir2
dirl
, server.example.com,
smith
SSH, "",
.
$ rsync -a -e ssh dirl smith@server.example.com:

-
-g
-
-t
-r
-1
133

(,

)
(,

)


, . .

http://itbookz.ru/

, )
-D

)
-
:
. : -Dgloprt
-v
: ,
. - -progress
,

-
, , ssh

Ipr
Ipq
Iprm

Linux , CUPS LPRng;


Fedora CUPS.
: Ipr, Ipq Iprm.
,
: CUPS LPRng.
, ,
.
,
Fedora, :
# redhat-config-printer
.
Ipr [] []
cups
/usr/bin
stdin stdout -file -opt --help --version
Ipr ( . line printer) .
$ Ipr -P irtyprinter myfile
134
http://itbookz.ru/


- _
-# N
-J

,

redhat-conf ig-printer
#
,
(

)

Ipq [] cups
/usr/bin
stdin stdout -file -opt --help --version
Ipq ( . line printer queue)
, .

- _
-
-1


_

:

Iprm [] [] cups
/usr/bin
stdin stdout -file --opt --help --version
Iprm ( . line printer remove) -
. Ipq ,
(, 61 78),
:
$ Iprm -P printername 61 78
, -
(
) - ,
.

135
http://itbookz.ru/


look
aspell
spell

Linux
.
, Linux
, ,
.
look [] [_\\\-\\
/usr/bin
stdin stdout -file opt --help --version
look ( ) ,
.
( /usr/share/dict/words).
, look bigg .
bigger
biggest
Biggs
-

, look ,
.

-f
-1


X
. , look -t i big
, ""

aspell [] \ aspell
/usr/bin
stdin stdout -file --opt -help -version

136
http://itbookz.ru/

aspell -
. .

aspell - file

file.

aspell -I < file


file
.
aspell dump master
aspell .
aspell help
.
http://aspell.net.
spell []
aspell
/usr/bin
stdin stdout -file opt -help -version
spell ,
, .
.
$ cat files \ aspell -I | sort -u
, spell
.

ps
uptime
w
137

http://itbookz.ru/

top
xload
free

- Linux.
, ,
, Linux
. ID-
, PID- ( ).
- , (.
" " 53):
,
, .
;
,
.
ps [] procps
/bin
stdin stdout -file -opt -help --version
ps
, , .
$ ps
PID TTY
4706 pts/2
15007 pts/2
16729 pts/2

TIME CMD
00:00:01 bash
00:00:00 emacs
00:00:00 ps

ps 80 ;
.
, , ps (GNU ps)
Unix- ps,
.
:
138
http://itbookz.ru/

$ ps ux
smith:
$ ps -U smith
program_ :
$ ps - _name
N:
$ ps -tW
1, 2 3505:
$ ps -pl,2,3505
,
:
$ ps -ef :
$ ps -efww
,
:
$ ps -efH
,
ps,
grep .
uptime procps
/usr/bin
stdin stdout -file --opt --help --version
uptime ,
.
$ uptime
10:54pm up 8 days,
3:44,
load average: 0.89, 1.00, 2.15

3 users,

139
http://itbookz.ru/

, :
(10:54pm), (8 , 3 , 44 ),
(3)
- (0.89),
(1.00) (2.15). -
,
.
w [ ] procps
/usr/bin
stdin stdout -file --opt --help --version
w
, , ,
.
$ W
10:51pm
up 8 days,
3:42,
8 users, load average:
0.00, 0.00, 0.00 USER TTY FROM LOGIN0 IDLE JCPU
PCPU WHAT barrett pts/0 :0 Sat 2pm 27:13m 0.07s 0.07s emacs
jones pts/1 hostl 6SepO3 2:33m 0.74s 0.21s bash smith pts/2 host2
6SepO3 0.00s 13.35s 0.04s w
,
uptime. , ( ^
, , ,
( man w
) . ,
.
,
w -hf s.

-h
-f
-s

He
He FROM
He JCPU PCPU
140
http://itbookz.ru/

top [\ procps
/usr/bin
stdin stdout -file --opt --help --version
top
,
(, ). ,
.
$ top
116 processes: 104 sleeping, 1 running,
0 zombie, 11 stopped
CPU states: 1.1% user, 0.5% system,
0.0% nice, 4.5% idle
Mem: 523812K av, 502328K used, 21484K free,
OK shrd, 160436K buff
Swap: 530104K av, OK used, 530104K free
115300K cached
PID USER PRI
N1 SIZE RSS SHARE STAT
%CPU %MEM TIME
COMMAND
26265 smith 10
0 1092 1092 840 R
4.7 0.2 0:00 top
1root 0
0 540 540 472 S
0.0 0.1 0:07 init
2root 0
0 0 0 0 SW
0.0 0.0 0:00 kflushd
top,
, ,
(s), (i)
(). h, , q,
.

-nw ^,
-dw '
-pN - . . . N,
,..., 20
141
http://itbookz.ru/

-

-

, . top-b-nl>
out file outfile
xload XFree86-tools
/usr/bin
stdin stdout -file --opt --help --version
xload,
.
( Y) ( X).

-update N
-scale JV

-hi
-1 abe 1 x
-nolabel
-jumpscroll N

' (
10)
Y N ( 1).
xload
; N -

,

(
)
He
,
^
( ,
)

free
procps
/usr/bin
stdin stdout -file --opt --help -version
free
.
$ free
total
used

free

shared buffers

cached
142

http://itbookz.ru/

Mem: 523812 491944 31868 0


67856
199276
-/+ buffers/cache: 224812 299000
Swap: 530104
0 530104
Linux
,
299000.

-sN
-b
-1
-


/
(-)
(-) -

"buffers/cache"

kill
( )
nice
renice
, ,
.

" " 53.
.
kill [] [/]
bash
stdin stdout -file --opt --help --version
kill .
( ), , ,
. .
, .
$ kill 13243
143
http://itbookz.ru/

-
-
-KILL:
$ kill -KILL 13243
.
,
(
-) .
,
pidof:
$ /sbin/pidof emacs
ps .
/bin/kill ,
kill,
. ,
:
$ kill -N PID
$ kill -NAME PID
- , N - , a NAME
- "SIG" (,
-HUP , SIGHUP).
, kill,
kill -1,
, kill .
, man 7
signal.
nice [-] coreutils
/bin
stdin stdout -file - -opt --help version
,
, , , ,
( ) ,
144
http://itbookz.ru/

.
nice.
7 .
$ nice -7 sort VeryLargeFile > outfile
,
10. , (. .
, ,
nice), nice .
$ nice 0
,
( ):
$ nice 10
(, , : " 10").
nice- ,
ps "NI".
$ ps - pid,user,args,nice
enice [] PID util-linux
/usr/bin
stdin stdout -file --opt --help --version
nice
, renice

.
nice- ( )
28734 .
$ renice +5 - 28734

( ),
( ). - -20
+20, ,

.
145
http://itbookz.ru/

- PID


(). -
PID (renice +5 28734)
- _

Logname
Whoami
id
who
users
finger
last
printenv

,

,

,


,
-

? .
: ,
.
logname
coreutils
/usr/bin
stdin stdout -file --opt --help -version
logname .
,
.
$ logname
smith
146
http://itbookz.ru/

whoami
/usr/bin

coreutils
stdin stdout -file --opt help version

whoami ,
. ,
(
logname), su.
whoami logname.
$ logname
smith
$ whoami
smith
$ su Password:
#logname
smith
#whoami
root
id [] [_]
coreutils
/usr/bin
stdin stdout -file opt --help -version

(UID)
(GID), . id

.
$ id
uid=500(smith) gid=500(smith)
groups=500(smith),6(disk),490(src),501(cdwrite)

-u
-g
-G

147
http://itbookz.ru/

-n

( )
.
-, - -G. ,
id -Gn ,
groups
.
-u, -g
-G
who [] [ ]
coreutils
"/usr/bin
stdin stdout -file -opt -help -version

who
,
.
$ who
smith :0
Sep 6
17:09
barrett pts/1 Sep 6
17:10
jones pts/2 Sep 8
20:58
jones pts/4 Sep 3
05:11
, who
/var/run/utmp. _
, , /var/log/wtmp
, /var/log/btmp
*.

-
-1
-n
-T


, ,



,
(. mesg
" "
221 ). ""
148
http://itbookz.ru/

-m
-q

"", "" - "",


""
, ,


. ,
users,
.

*
.

users [ ] coreutils
/usr/bin
stdin stdout -file -opt --help -version
users ,
.
(),
.
$ users
barrett jones smith smith smith
who, users no
/var/ log/utmp,
.
finger [\ [[@\]
finger
/usr/bin
stdin stdout -file opt -help -version
finger
:
$ finger
Login Name Tty
Idle Login Time
smith Sandy Smith :0
Sep 6 17:09
barrett Daniel Barrett :pts/l 24 Sep 6 17:10
jones Jill Jones
:pts/2 Sep 8 20:58
:
$ finger smith
149
http://itbookz.ru/

. Login: smith
Name: Sandy Smith
Directory: /home/smith
Shell: /bin/bash On since Sat
Sep
6 17:09 (EDT) on :0 Last login Mon Sep
8 21:07
(EDT) on pts/6 from localhost
No mail.
Project:
Enhance world peace
Plan:
Mistrust first impulses; they are
always right.

@.
finger,
.

-1
-s
-



Project Plan,
-/.projects -/.plan

last [] [] {] SysVinit
/usr/bin
stdin stdout -file --opt --help -version
last
.
$ last
barrett pts/3 localhost Mon Sep 8 21:
07 - 21:08 (00:01)
smith pts/6 :0
Mon Sep 8 20:
25 - 20:56 (00:31)
barrett pts/4 myhost
Sun Sep 7 22:
19 still logged in
150
http://itbookz.ru/

,
.

-N

'- ,
N-
-i
IP-
-R

-

(,

)
-f _
-
/var/run/utmp, . who

printenv [ } coreutils
/usr/bin
stdin stdout -file -opt help -version
printenv ,
-, :
$ printenv =/home/smith MAIL=/var/spool/mail/smith
NAME=Sandy Smith SHELL=/bin/bash
:
$ printenv HOME SHELL /home/smith /bin/bash

useradd
userdel
usermod
passwd
chfn

151
http://itbookz.ru/

chsh

Fedora
,
. , ,
.
- ,
. -
"",
,
, ,
.
useradd [] shadow-utils
/usr/sbin
stdin stdout -file --opt -help --version"
useradd
.
# useradd smith
(

useradd -D),
.
# useradd -d /home/smith -s /bin/bash -g users smith

-d

-s
-u uid


uid.
, ,

152

http://itbookz.ru/

-g

-G rpynnai, 2,...
-m


,

, ,



!, 2 . .
""
/etc/skel,
.

()
, , -/.bashprofile,

.

, - (-
)

userdel [-] shadow-utils


/usr/sbin
stdin stdout -file opt --help --version
userdel .
# userdel smith
,
-. ,
;
( usermod -L) ,
. ,
, : -
.
usermod [] _ shadow-utils
/usr/sbin
stdin stdout -file --opt --help version
153
http://itbookz.ru/

usermod
, .
# usermod -d /home/another smith


-d
-1 _

-s _

-g

-G 1, 2, . . .

-L


_ .
, ,
, -

. , ,

(root, daemon . .)!

,


,


, ,




: 1,
2,...

,
,

,
154

http://itbookz.ru/




,
-L

-U

passwd [] [_]
passwd
/usr/bin
stdin stdout -file --opt -help --version
passwd
:

#passwd
(
):
#passwd smith
passwd ,
.
.
chfn [] [ ]
util-linux
/usr/bin
stdin stdout -file opt -help -version
chfn ( . change finger)
, :
, ,
, finger.
, chfn
; ()
,
. chfn
.
$ chfn
Password: ********
Name [Shawn Smith]: Shawn E. Smith
155
http://itbookz.ru/

Office [100 Barton Hall]:


Office Phone [212-555-1212]: 212-555-1234
Home Phone []:

-f
-h
-
-

chsh [] [ ]
util-linux
/usr/bin
stdin stdout -file --opt -help --version
chsh ( . change shell)
, , .
chsh
; ()
,
. chsh
.
$ chsh
Changing shell for smith.
Password: ********
New shell [/bin/bash]: /bin/tcsh
/etc/shells.

-s ^
-1


156
http://itbookz.ru/

, ,
, . ,
root,
, .
,
.
$ SU -1
Password: # ********
(,
, , ).

(#), ,
.
-,
exit,
.

. ,
, sudo,
.
su :
$ su -I jones Password: *******
( ,
).

-1

-m

.
,

root

157
http://itbookz.ru/

- (
) ( exit).
, man sudo
-s _
(, /bin/bash)


groups

groupadd
groupdel
groupmod

- ,
.
- (
), .
, friends
, /tmp/sample.
$ groups
users smith friends
$ chgrp friends /tmp/sample
$ chmod 770 /tmp/sample
$ Is -1 /tmp/sample
-rwxrwx
1 smith friends 2874 Oct
20 22:35 /tmp/sample
,
/etc/group*, . ,
, chgrp,
" " 95.
groups \_\
coreutils
/usr/bin
stdin stdout -file --opt --help -version
groups Linux-,
.
158
http://itbookz.ru/

$ whoami
smith
$ groups
smith users
$ groups jones root
jones .- jones users
root : root bin daemon sys adm disk wheel src
* -.

groupadd []
. shadow-utils
/usr/sbin
stdin stdout -file opt --help -version
groupadd .
- f ,
.
#groupadd -f friends

-g gid
-f


, groupadd

,

groupdel shadow-utils
/usr/sbin
stdin stdout -file --opt --help --version
groupdel .
#groupdel friends
, ,
,
:
#find / -group friends -print
159
http://itbookz.ru/

groupdel
.
.
groupmod []
shadow-utils
/usr/sbin
stdin stdout -file --opt --help --version
groupmod :
.
#groupmod -n newname friends
groupmod ,
:
.
,
.

- g gid
-n

gid


uname
hostname
dnsdomainname
domainname
nisdomainname
ypdomainname
ifconfig



To , hostname
-d
To , hostname
-
To , hostname
-
To , hostname
-

Linux- ( ) , IP-
. ,
.
uname []
coreutils
160
http://itbookz.ru/

/bin

stdin stdout -file --opt -help -version

uname
:
$ uname -a
Linux server.example.com 2.4.18-27.8.0 #1 Fri Mar
14 06:45:49 EST 2003 1686 i686 i386 GNU/Linux
(Linux),
(server.example.com), (2.4.18-27.8.0 #1 Fri Mar 14
06:45:49 EST 2003), (1686),
(i686), (i386)
(GNU/Linux).


-
-s
-
-
-
-
-i
-


( )





hostname [] [] net-tools
/bin
stdin stdout -file --opt --help --version
hostname .

:
$ hostname
myhost.example.com
:
161
http://itbookz.ru/

$ hostname
myhost
,
.
- ,
.
!

-i
IP-
-

-s

-f

-d
DNS-
-
NIS- YP-
-F
,

ifconfig net-tools
/sbin
stdin stdout -file opt -help version
i f conf ig
.
,
.

( ethO),
.
$ ifconfig ethO
ethO Link encap:Ethernet HWaddr 00:50:BA:48:4F:BA
inet addr:192.168.0.10 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST
MTU:1500
Metric:1
RX packets:1955231 errors:0 droppediO overruns:0 frame: 0
TX packets:1314765 errors:0 dropped:0 overruns:0
162
http://itbookz.ru/

carrier:
collisions:0 txqueuelen:10 0
RX bytes:2320504831 (2213.0 Mb)
TX bytes: 152785756 (145.7 Mb)
Interrupt:11 Base address:0x6000
-
(00:50:BA:48:4F:BA), IP- (192.168.0. 10),
(255.255.255.0) .
,
.
$ ifconfig -a
,
man- ifconfig , .

host
whois
ping
traceroute

, IP- DNS
-
,

, ,
. ?
IP-? ?
host [] []
bind-utils
/usr/bin
stdin stdout -file --opt --help -version
host
IP- , DNS.
$ host www.redhat.com
www.redhat.com has address 66.187.232.50
$ host 66.187.232.50
50.232.187.66.in-addr.arpa domain name
pointer www.redhat.com.
163
http://itbookz.ru/

.
$ host -a www.redhat.com Trying "www.redhat.com"
->>HEADER- opcode: QUERY, status: NOERROR, id:
50419
flags:
gr
rd ra,QUERY:
1,
ANSWER: 1,
AUTHORITY: 3, ADDITIONAL: 3
; QUESTION SECTION:
www.redhat.com.
IN ANY
; ANSWER SECTION: www.redhat.com.
196 IN A
66.187.232.50
AUTHORITY
SECTION: redhat.com.
90535
IN NS
ns2.redhat.com. redhat.com.
9053 5
IN NS ns3.redhat.com.
redhat.com. 9053 5 IN NS nsl.redhat.com.
;; ADDITIONAL SECTION:
ns2.redhat.com. 143358 IN A 66.187.224.210 ns3.redhat.com.
143358 IN A 66.187.229.10 nsl.redhat.com.
143358
IN A
66.187.233.210

. , , ""

DNS- .
comcast.net.
$ host www.redhat.com ns01.jdc01.pa.comcast.net
Using domain server:
Name: ns01.jdc01.pa.comcast.net
Address: 66.45.25.71#53
Aliases:
www.redhat.com has address 66.187.232.50
,
host.

-
-1


: A, AXFR, CNAME, HINFO, KEY,
164
http://itbookz.ru/

MX, NS, PTR, SIG, SOA .


$ host -t MX redhat.com
redhat.com mail is handled by 20 mx2.redhat.com.
redhat.com mail is handled by 10 mxl.redhat.com.
host , ,
dig, DNS-.
nslookup,
, Linux- Unix.
whois [] _
jwhois
/usr/bin
stdin stdout -file -opt -help --version
whois
-:

$ whois redhat.com
Registrant:
Red Hat, Inc. (REDHAT-DOM)
P.O. Box 13588
Research Triangle Park, NC 27709
,
,
.

-h
-p


. ,
whois -h whois.networksolutions. com yahoo.com.
TCP-
43 ( whois)

ping [\ iputils
/bin
stdin stdout -file -opt --help --version
165
http://itbookz.ru/

ping , .
(ICMP-, )
.
$ ping google.com
PING google.com (216.239.37.100) from
192.168.0.10 : 56(84) bytes of data.
64 bytes fromwww.google.com (216.239.37.100)
: icmp_seq=O ttl=49 time=32.390 msec
64 bytes fromwww.google.com (216.239.37.100)
: icmp_seq=l ttl=49 time=24.208 msec
AC
google.com ping statistics
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/mdev = 24.208/28.299/32.390/4.091 ms

- N
- N
-n

N
( 1 )

IP-,

traceroute [] [_] traceroute


/bin
stdin stdout -file --opt -help version
traceroute
,
, .
$ traceroute yahoo.com
1server.example.com (192.168.0.20)
1.397 ms 1.973 ms
2.817 ms
210.221.16.1 (10.221.16.1)
15.397 ms 15.973 ms
10.817 ms
3gbr2-plO.cblma.ip.att.net
(12.123.40.190)
11.952ms
166
http://itbookz.ru/

11.720 ms 11.705 ms
16 p6.www.dcn.yahoo.com
(216.109.118.69)
24.757ms 22.659 ms

.
, .
, traceroute .
traceroute
, .

!F
!
!N
!
!S
!
!N







ICMP , N

40 ,
_
(, traceroute myhost 120).

-n
-w N

ssh
telnet
scp
sftp
ftp

: IP-

- /



(!)
/
( )
/
()
/

167
http://itbookz.ru/

(, !)
Linux,
.
, .
ssh [] []
openssh-clients
/usr/bin
stdin stdout -file --opt --help --version
ssh ( . secure shell)
, .
$ ssh remote.example.com

.
$ ssh remote.example.com who
ssh ,
, (
).
SSH ,
, .
man- sshd.

-l _


; ssh

.

@.
$ ssh smith@server.example.com


(22)

-t

168
http://itbookz.ru/

-v

; ,


, ,

,

telnet [] [\ telnet
/usr/bin
stdin stdout -file -opt --help -version

telnet ,
.
$ telnet remote.example.com
telnet
:
, -
. ssh,
.
.
Kerberos (
Telnet ,
). Fedora telnet Kerberos.
http://web.mit.edu/kerberos/
.
,
. ,
- ( 80) .
$ telnet remote.example.com 80
Trying 192.168.55.21... Connected to remote.example.com
(192. 168.55.21).
Escape character is 1A] ' . xxx
-
Enter <HTML><HEAD> # Yep, it's a web
server , - <TITLE>400
Bad
Request</TITLE> </HEAD><BODY> <Hl>Bad Request</Hl> Your
169
http://itbookz.ru/

browser sent a request that this server could not understand.<P>


</BODYx/HTML> Connection closed by foreign host.

telnet, .
scp
openssh-clients
/usr/bin
stdin stdout -file -opt help --version
scp ( . secure copy)
( ) (
) (
, sf tp).
,
.
$scp myfile remote.example.com:newfile
$scp -r mydir remote.example.com:
$scp remote.example.com:myfile .
$scp -r remote.example.com:mydir .
204 | Linux.

, _@.
$ scp myfile smith@remote.example.com:
-
-r
-v

(, )


,
sftp ( | tfM*_f70#b30BareMfi@xoc7)openssh-cr\ents
/usr/bin stdin stdout -file -opt --help -version

sftp
( scp,
). ,
ftp.
170
http://itbookz.ru/

$ sftp remote.example.com
Password: ********
sftp> cd MyFiles
sftp> Is
README
filel
file2
file3
sftp> get file2
Fetching /home/smith/MyFiles/file2 to
file2
sftp> quit

,
_@:
$ sftp smith@remote.example.com

help
ls



(Is) (11s)

pwd
lpwd

(pwd)
(lpwd)

cd dir
lcd dir

(cd)
(ld)
dir
get 1 [2] /

2
put 1 [2]

171
http://itbookz.ru/

mget file*


,
* ?

mput file*


,
* ?

quit

sftp

ftp []
/usr/bin stdin stdout -file - -opt - - help - -version
ftp ( . file transfer protocol)
, :
. ftp,
, sftp.
, s f tp,
ftp ( ,
).


evolution

mutt
mail


Fedora
.
.
- pine, RMAIL vm, emacs,
mozilla Mail & News.
,
,
/var/log/maillog.
mailq ,
172
http://itbookz.ru/

,
.
evolution
evolution
/usr/bin stdin stdout - file -- opt help version
Ximian Evolution - ,
Microsoft Outlook.

Evolution Internet: Evolution Email,
evolution .
| 207
,
.
1.
Tools > Settings... ( >
)
2.
Evolution Settings ( Evolution),
, Add
().
Edit ().
. Evolution Account Editor (
Evolution), Identity (),
.
4.
Receiving Mail (
)
(IMAP, POP, . .)
. POP- IMAP ,
-
;
.
5.
Sending Mail ( )
: SMTP
, (
), sendmail,
- .
6.
-
. ,
Evolution Account Editor.
173
http://itbookz.ru/

.
Inbox
New

Send/Receive

208 | Linux.
Reply
Reply To All

Forward
- !
mutt [] mutt
/usr/bin stdin stdout - file -- opt --help --version
mutt - ,
( ),
(, xterm),
SSH-. ,
. , .
$ mutt
,
, .
. 4.
4. mutt,

PageUp
PageDown

Home
End

4. mutt,
()


m
.

174
http://itbookz.ru/

.
""",
, "q",
. ,
m
f .
, m
i

d
,
, . 5.
5.
mutt,

()

b

Reply-To ( )
S Subject ()


q ,
, . 6, .
6. mutt

? (
, "q" - )


q
mutt - http://www. mutt.org,
mutt http://www. cs.
utk. edu/~help/mail/mutt_starting.php.
175
http://itbookz.ru/

mail []
MailX
/bin
stdin stdout - file -- opt --help --version
mail ( Mail)* -
, .

,

mail.
,
.
$ mail smith@example.com
Subject: my subject
I'm typing a message.
To end it, I type a period by itself on a line.
Cc: jones@example.com
$
* Unix- mail Mail
, Linux : /usr/bin/Mail-
/bin/mail.
,
.
$
echo
"Hello world"
|
mail
-s "subject"
smith@example.com
,
.
$ mail -s "my subject" smith@example. com < filename
$
cat
filename
|
mail
-s
"my subject"
smith@example.com
,
.

-s subject
SubpctfteMa)

-v
:

- addresses

(), addresses
176
http://itbookz.ru/

-b addresses

(), addresses

-
mozilla -
lynx
-
wget
- .
curl
-
Linux www:
,
-.
mozilla [][1/
mozilla
/usr/bin stdin stdout -file --opt --help -version
Mozilla - -
Linux; .
.
$ mozilla &
Mozilla (
, , ,
), ,

-
.


Usenet. Help ()
Help Contents (),
http://www.mozilla.org.
- Linux - Firebird (
Mozilla, http://www.mozilla.org/products/fiire-bird), Netscape (
, Mozilla, http://www.netscape.com), Opera
(http://www.opera.com),
Konqueror

KDE
(http://www.konqueror.org),
Epiphany

GNOME
(http://www.gnome.org) Galeon ( Mozilla,
http://galeon.sourceforge.net).
lyn [] [URL] lynx
/usr/bin stdin stdout - file - opt --help --version

177
http://itbookz.ru/

lynx - -: ,
, ,
.
$ lynx http://www.yahoo.com
,
. ,
,
.

?

k


^G

q
lynx
Enter
""


,
""
g
URL- (
)



^

^

m
/ (main/home)
/


=

178
http://itbookz.ru/

\
lynx

HTML- (
, )
100 ,
man-.

- dump
(
-source)
-source HTML-

( wget
curl)
-emacskeys
, lynx
emacs
-vikeys , lynx
vim ( vi)
-homepage=URL

URL
-color
-nocolor
wget [] URL wget
/usr/bin stdin stdout -file -opt --help --version
wget URL-
.
-
. ,
Yahoo:
$
wget
http://www.yahoo.com
--23:19:51-http://www.yahoo.com/
=> index.html'
Resolving
www.yahoo.com...
done. Connecting to
www.yahoo.com[216.109.118.66]: 80... connected.
HTTP request sent, awaiting response... 200 OK Length:
unspecified [text/html]
[ <=>
] 31,434
220.84K/S
23:19:51 (220.84 KB/s) - index.html' saved [31434]
179
http://itbookz.ru/

index.html
, wget
, , , - :
wget -cc URL-,
, .
- curl,
wget,
.
$ curl http://www.yahoo.com > mypage.html
wget 70 ,
( curl
; man-).

-i filename

- filename
-c

-t N

URL-
filename
HTML-
filename,
:
,
,
. , wge t 10
150, -

50. wget
,
() ,
,
,
/N,
. N=0

--progress=dot
--progress=bar

[dot)
{bar)
.
180
http://itbookz.ru/

--spider

-nd

,

( wget
)

-r

-1 N

/N-
( 5)


, ,

-L

(
)

-
: ,
patternl,pattern2,
pattern3, .. .
patternN.
,

181
http://itbookz.ru/

-R

: ,

patternN

patternl,patternZ, pattern3,...
-I
:
,

patternN
patternl,pattern2,
patterns, .. .
-X

:
,

patternl,pattern2,
patterni, . . .

Usenet
Usenet News -
.
, ,
. Fedora
slrn,
,
(rn, trn, tin, ). Mozilla
Usenet News: Window Mail & Newsgroups.
Usenet News
Google Groups, http.V/groups.google. com.
Usenet,
, -,
.
(, news.example.com),
,
, , .

-/.newsrc, -/.jnewsrc.
slrn [] slrn
182
http://itbookz.ru/

/usr/bin stdin stdout -file opt help version


slrn - Usenet.
, ,
NNTPSERVER.
$ export MNTPSERVER=news.example.com
(
S'lrn):
$ slrn --create :
$ slrn
Usenet I 219
slrn
(News Groups) ,
. . 7 .
7.
Usenet

slrn



Enter

(
)
u


( ,
).
s,
Enter, ,
slrn Group (),
( "") . . 8
,
.
8. slrn

183
http://itbookz.ru/




Enter


:
ESC-u,

9 ,
. 9.
slrn,

q

Group
Spacebar


b


r


f

p

o

n


p


"?",
. slrn ,
-/.slmrc.
; /usr/share/doc/slrn*
http://www.slrn.org .


gaim
talk
write
mesg

IRC-
Linux/Unix

write talk
184
http://itbookz.ru/

tty

Linux
,
- Internet - talk
write, Linux- (tty),

gaim.
gaim [] gaim
/usr/bin stdin stdout -file --opt help --version
gaim - ,
, AOL, MSN,
Yahoo . IRC-.
.
$ gaim &
IM-,
; ,
http://www.aim.com, AOL Instant
Messenger. , Accounts
( ), gaim,
,
.

-u screenname

screenname
-1
gaim
(,

)
-w [message]
"",
message
talk \@\ [tty\
talk
/usr/bin stdin stdout -file opt help version
talk
:
, ,
" ". Linux- Unix ( )
185
http://itbookz.ru/

, , xterm.
, , , ,
.
$ talk friend@example.com
,
.
write [tty\
Util-linux
/usr/bin stdin stdout -file --opt --help --version
write , talk:
Linux.
$ write smith Hi, how are you? See you later.
.
write .
$ echo 'Howdy!' | write smith
mesg [ I n] SysVinit
/usr/bin stdin stdout - file - - opt - -help - -version
mesg , talk- write . mesg
, mesg n - , a mesg -
("" -, "" - )*, mesg
, , gaim.
$ mesg
is n
$ mesg
tty
coreutils
/usr/bin stdin stdout - file - opt --help -version
tty
(), .
$ tty /dev/pts/4


echo

186
http://itbookz.ru/

printf

yes


seq


clear
* mesg Fedora
"tty device is not owned by
group 'try'". , .
Linux
,
.
$ echo hello world hello world
.
Linux,
shell- (. "
" 256).
echo [] bash
stdin stdout - file - - opt - - help - -version
echo .
$ echo We are having fun We are having fun
, echo
. /bin/echo,
Linux
echo. ,
, type echo.

-n

-

.
,

echo ' hel lo\a' echo - ' hello\a '.


,
-

: -

.
187
http://itbookz.ru/

\
( )
\
(Backspace)
\
(
, - )
\f

\

\

\t

\v

\\

\'
\"

\ ASCII-

printf [/\ bash


stdin stdout -file --opt --help --version

printf

echo

:
. printf ()
,
,
.
$ printf "User %s is %d years old.\n" sandy 29 User sandy
is 29 years old.
- ,
, %s %d.
, sandy 29,
printf ,
.
.
$ printf "ThatVll be $%0.2f, sir.Xn" 3 That'11 be $3.00,
sir.
printf Linux:
bash, - /usr/bin/printf.
, %q,
, bash:
-"\",
188
http://itbookz.ru/

.
.
$ printf "This is a single quote: %s\n" "'" This is a
single quote: '
$ printf "This is a quote: %q\n'
This is a single quote: \'
,
printf.
, , , printf
(0 - , "" - ). ,
,
printf . shell-,
.
man-
printf ( man 3 printf).
.
%d

%ld

%

%

%f

%lf

%

%s

%q


%%


,
. , "%5d"
, . "%6 . 2 f" -

.
.
n

On
,

189
http://itbookz.ru/

n. m
,

print
f

, , "\" ( )
"\" (). echo
.
yes [] coreutils
/usr/bin stdin stdout - file - opt help --version
yes ( "" )
, .
$ yes again again again again
,
yes
.
" , "?
yes ,
.
$
yes
|
my_interactive_command
^interactive'_command , yes.
seq [] coreutils
/usr/bin stdin stdout - file - opt --help -version
seq
,
. .
: seq
1 .
$ seq 3
1
2
3
:
seq
.
$ seq 5 2
5
4

190
http://itbookz.ru/

3
2
: ,

seq ,
(
).
$ seq 1.3 2
1
1.3
1. 6
1.9

-w
,
:
$ seq -w 8 10
08
09
10
-
printf .
% (
), % % f
$ seq -f '**%**' 3
**1**
**2**
**3**
-s
. :
$ seq -s ':' 10 1:2:3:4:5::7:8:9:10
230 | Linux.
clear ncurses
/usr/bin stdin stdout - file -- opt --help --version

.


191
http://itbookz.ru/

xcalc



dc

? Linux
,
.
xcalc [] XFree86-tools
/usr/X16R6/bin
stdin stdout - file -- opt --help --version
xcalc .
;
(RPN),
-.

coreutils
/usr/bin stdin stdout - file -- opt -help --version
(
) .
| 231
$ 7+3
10
$ ' ( ' 7 + 3 ' ) ' ' * ' 14

140
$ length ABCDEFG
7
$ 15 '>' 16
0
.
,
,
. ()
. . 10
.
10.


192

http://itbookz.ru/

-
*
/
%
( )
<
<=
,

>
,

10. ()



=
!=

"" ""
&
""
""
s :

5?
substr s
s,
(=1 - )
index s chars
5,
chars. 0, . ,
- index ()
0
""; - "".
: 0 ""; 1 - "".
.
Perl.
dc [] []
be
193
http://itbookz.ru/

/usr/bin stdin stdout - file -- opt -help --version


dc ( . desk calculator) -
(RPN),
-
. , RPN Hewlett-Packard,
dc, .
, dc
. .
.
q dc
f
()

()

( 0: )
,
,
.
+

*
/
%

( - ,
- )
, ,
.
v
.
$ dc
4 5 + 4 5
9
2 3 * 2 3
194
http://itbookz.ru/

8
10 * 10
80
f
80 9 +


89
"
'

xclock
cal

date

ntpdate ,

? ?

.
xclock []
XFree86-tools
/usrfid 1R6/bin
stdin stdout - file - opt --help --version
xclock .
, -:
, oclock (), t3d (
,
/usr/Xl IR6/lib/xscreensaver/) ,
GNOME KDE.

-analog
-digital
[-brief]

; -brief,
-update N
/
cal [] [ []] util-linux
/usr/bin stdin stdout - file -- opt --help --version
cal , -
.
$cal
September 2003
Su
Mo Tu
1
2
3

We
4

Th
5

Fr
6

195
http://itbookz.ru/

Sa

78
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
,
: cal 8 2002. (cal 2002),
.

-

-
:

-j
;

1 244-, 2 - 245-, . .
236 | Linux.
I
date [] []
coreutils
/bin
stdin stdout - file - opt --help -version
date .
.
$ date
Sun Sep 28 21:01:31 EDT 2003
,
, .
$ date '+%D'
09/28/03
$ date '+The time is %1:%M %p on a
beautiful %A in %B'
The time is 9:01 PM on a beautiful
Sunday in September


%
, 12-
Sun 28
Sep 2003,09:01:25 EDT
%D
, 2 09/28/03
%
, 4 09/28/2003
196
http://itbookz.ru/

%
%

%
%
%
%
%Z
%

, 24-
, 12-

21:01:25
09:01:25 PM

()
Sun
() Sunday
()
Sep
()
September

EDT
AM ( ) ( )

| 237

%w
(0-6, =)
0
%u
(1-7, 1=)
7
%d
, 02
%e
,
2
%j
, 005
%m
,
09
%y
, 2
03
%Y
, 4
2003
%M
,
09
%s
,
05
%1
, 12- ,
9
%I
, 12- , 09
%k
, 24- ,
9
%H
, 24- , 09
%N

737418000
%s
Linux: 1 ,
1970 1068583983

%n

%t

%%

%

date .
197
http://itbookz.ru/

-d

- _

,

- s
/ ;


a ntpdate _ ntp
/usr/bin stdin stdout - file -- opt --help --version
ntpdate ,
.
, .
# /usr/sbin/ntpdate timeserver.someplace.edu
7
Sep
21:01:25
ntpdate[2399]:
step time
server
178.99.1.8 offset 0.51 sec

, ntpd;
http://www.ntp.org.
, Google
"public ntp time server" (" ntp ").

sleep ,
watch
at

crontab


, Linux

.
sleep coreutils
/bin
stdin stdout - file -- opt --help --version
198
http://itbookz.ru/

sleep .
() ,
s ( ), m (), h ()
d ().
$ sleep 5m He 5
sleep
.
$ sleep 10 && echo ' .1 (
10 ) .
watch [] procps
/usr/bin stdin stdout - file -- opt help version
watch
; - .
(
),
,
,
. , watch -n 6 0 date
date , - . ,
.

-
,

-d
,
,

at []
at
/usr/bin stdin stdout - file opt --help --version
at
.
$ at 7am next Sunday
at> echo He
| mail smith
at> lpr $HOME/shopping-list
at> ~D
<EOT>
job 559 at 2003-09-14 21:30
199
http://itbookz.ru/

, at,
. , :
( );
( );
( ,
);
, , now (),
midnight () teatime (16:00);
,
, ,"+ 3 days" ( ).
: december () 25 2003,25 december 2003, de-cember 25, 25
december, 12/25/2003, 25.12. 2003, 20031225, today (), thursday
(), next thursday ( -), next month
( ), next year ( ) .
(j an -, f
eb - , mar - ,...). :
8pm (8 ), 8pm, 8:00pm, 8:00 pm, 20:00 2000
. ,
: + 3 seconds
( ), + 2 weeks ( ), - 1 hour (
) . *.
, at
.
"next year" ( ) ,
, "thursday" ()
, "december 25" (25 ) - 25 , a
"4:30pm" (16:30) - 16:30.

, ,

.
(. print env) ,
,
. at,
.
200
http://itbookz.ru/

*
/usr/ share/doc/at- */timespec.
at, atq ("at
queue" - at).
$ atq
559 2003-09-14 07:00 a smith
at, atrm ("at remove"
- at) .
$ atrm 559

- f


-


crontab [] []
vixie-cron
/usr/bin stdin stdout - file -- opt --help --version
crontab, at,
. crontab
, "
". ,
( crontab):
$ crontab -e

{/var/spool/cron). Linux , crontab
, .
$ crontab -e
crontab
($EDITOR).
$ crontab -I
crontab .
$ crontab -r
crontab $ crontab myfile
myfile crontab.
- username
crontab- .
201
http://itbookz.ru/

crontab (
, "#", ).
, .
, ,
- .

0 59. (30),
, (0,15,30,45),
(20-30), (0-15,50-59)
, . . "". " n- "
/; , */12 0-59/12
0-,12-,24-,36-,48- ( , 12 ).

, .

1 31;
, ,
.

1 12;
, ,
. ,
(jan - , f eb - , mar - . .),
.

0 () 6 ();

,
,
. ,
(sun - ,
-, tue - . .),
.

,
,
$
. -
(, /usr/bin/who who).
202
http://itbookz.ru/

II .
11. crontab

45
* * 45
(1:45, 2:45 )
45
9
9:45
45
9
8

9:45
45
9
8
12 8 9:45
45
9
8
dec * 8 9:45
45
9
*
6 9:45
45
9
*
* sat 9:45
45
9

12 6 , 9:45

45
9
8
12 6 8
, 9:45
-
, .


gqview -
ksnapshot

gimp
gnupfot
xscreensaver
Linux
.
, ,

. - ,
,
.
[] []
/usr/bin " stdin stdout - file - opt help --version
(Eye of Gnome)
.
203
http://itbookz.ru/

, .
:
$
eog filel.jpg file2.gif
file3.pbm
.
,
; ,
, ,
( --help).
gqview [] []
gqview
/usr/bin "
stdin stdout - file -- opt help --version
gqview

, . ,
, ,
. ,
. Aq,
.

-f

(
v)
-s
-
(
- s)
ksnapshot [] kdegraphics
/usr/bin stdin stdout - file -- opt help version
ksnapshot -
. :
$ ksnapshot
.

. -
;

: jpg
JPEG-, . - Windows, . -
204
http://itbookz.ru/

,. eps -
Postscript-, .ico - Windows .
,
Save Snapshot (" ")
Filter ().
Help
() ksnapshot ksnapshot -help-all .
gimp [] []
gimp
/usr/bin stdin stdout - file -- opt --help -version
GIMP
(GNU
Image
Manipulation
Program)

,
Adobe Photoshop
. ,
.
http://www.gimp.org.
, .
$ gimp

.
$ gimp filename
GIMP ,
xv
http://www.trilon.com/xv. :
$ xv myfile.jpg
.
.
gnuplot [] []
gnuplot
/usr/bin stdin stdout - file - - opt - - help - -version
gnuplot ,
,
, , Postscript.
gnuplot, ,
. = 2
=1 =10,
.
$ gnuplot
205
http://itbookz.ru/

gnuplot> plot [1:10] **2


gnuplot> quit

Postscript-, .
$ echo 'set terminal postscript; plot [1:10] x**2'
|
gnuplot > output.ps
http://www.gnuplot.info
.
xscreensaver xscreensaver
/usr/X11R6/bin
stdin stdout - file -- opt --help --version
xscreensaver -
.
, .
. ,
Fedora (KDE GNOME)
xscreensaver
.
. KDE Control 1(
), Appearance & Themes (
), Screen Saver ( ).
, Configure
Desktop ( ), Screen Saver (
). GNOME Preferences/
Screensaver (/ ).
. (
GNOME KDE)
Lock Screen ( ).
, .
. xscreensaver-demo,

. xscreensaver-command,
.
$ xscreensaver-command -activate
command -next
$ xscreensaver-command -prev
$ xscreensaver-command -cycle

$ xscreensaver


206

http://itbookz.ru/

$ xscreensaver-command -lock
$ xscreensaver-command -exit


grip

xmms
cdparanoia
audacity
xcdroast

-,
- (, WAV)
(rip) - WAV-
-
-

Linux- , , . , ,
,
,
. , , , ,
.
MIDI Linux, http://linux-sound.org/
http://www.xdt.com/ar/linux-snd.
Fedora ,
.

mpgl23
(http://
www.mpgl23.de/),
smpeg
(http://www.lokigames.com/
development/),

mplayer
(http://www.mplayerhq.hu).
grip
grip
/usr/bin
stdin stdout - file -- opt --help --version
grip - - : -, -, WAV-
-.
.
cdparanoia[\ [_^\
/usr/bin
stdin stdout - file -- opt -help --version
207
http://itbookz.ru/

cdparanoia -
- WAV- ( :
. man-). .
$ cdparanoia N TV .
$ cdparanoia -
-
.
$ cdparanoia - 2-4
2-, 3- 4- .
$ cdparanoia 2-4
2-, 3- 4- .
,
cdparanoia -Qvs (" CD-ROM-
") .
WAV- -, LAME
(http://lame.sourceforge.net/)

Not-Lame
(http://www.
idiap.ch/~sanders/notjame/).
xmms [] [/\ xmms
/usr/bin
stdin stdout - file -- opt --help -version
xmms (X MultiMedia System) -
-, , WAV,
Ogg Vorbis -*.
,
CD-,
.
- , :
* Fedora xmms -;
http://vnvw.xmms.org/,
, .

$ xmms - :
$ xmms filel.mp3 file2.wav file3.ogg ...
.

208
http://itbookz.ru/



PL

( Add,
)
EQ




audacity []
audacity
/usr/bin
stdin stdout - file - - opt - - help - -version
audacity - -
WAV, MP3 Ogg . ,
,
-,
(, , . .) .
audacity Fedora,
http://audacity.sourceforge.net.
xcdroast []
xcdroast
/usr/bin
stdin stdout - file -- opt --help --version
xcdroast - -
.
SCSI-. IDE-, ,
ide-scsi.
, , ,
CD- :
$ cdrecord -scanbus
.
- "CD-Writing Howto"
(http://www.tldp.org/HOW-TO/CD-Writing-HOWTO.html).

, xcdroast, http://
209
http://itbookz.ru/

www.xcdroast.org , FAQ
( ),
. .
$ xcdroast
Setup () ,
. Save Configuration
( ), , .
Duplicate CD ( -)
Create CD ( -), , . .
, , , ,
,
-.

, (bash),
, .
, , shell-,
,
. ,
,
(if-then-else), , ,
. shell-,
,
, .
, info bash.

Shell- bash
. " "
,
, .
,
: , .
, ,
.
210
http://itbookz.ru/

.
$ MYVAR=6
$ echo $MYVAR
6
, ,
, ,
.
$ NUMBER="10"
$ expr $NUMBER + 5
15
shell-,
,
.
, ,
,
,
.
$ FILENAME="My Document"
$ Is $FILENAME
Is: My: No such file or directory



! Is
2
Is: Document: No such file or directory
$ Is -1 "$FILENAME"

My Document Is
l

, ,
.
$ ="fedora"
211
http://itbookz.ru/

$ echo "The plural of $HAT is $HATs"


The plural of fedora is !
"HA Ts "
$ echo "The plural of $HAT is "${HAT}s"


echo printf, " "
224.
$ echo "Hello world"
Hello world
$ printf " %d \" 'expr 20 + 20"
40

read,
.
$ read name
Sandy Smith <ENTER>
$ echo "I read the name $name"
I read the name Sandy Smith



,
(/ ) .
0 "" "",
- "" "".
, Linux-
,
(return code)
(exit status).
$?.
212
http://itbookz.ru/

$ cat myfile
My name is Sandy Smith and
I really like Fedora Linux
$ grep Smith myfile
My name is Sandy Smith and
... $ echo $?
0...
""
$ grep aardvark myfile
$ echo $?
...
1...
""
, ,
man-.
test "["
test ( )
,
, , ,
0 () 1 ().
$ test 10 -It 5
10, 5?
$ echo $?
1
$ test -n "hello" "hello"
?
$ echo $?

--
test
. 12.
test , "[" (
),
. ,
"]" (
), test.
213
http://itbookz.ru/

,
.
$[ 10
$echo
1
$[ -n
$echo

-It 5 ]
$?
"hello" ]
$?

, "[" - , ,
,
. :
$ [ 5 -It 4]

4 ] bash: [: missing ']'
test ,
"4]", , .
260 | Linux.
12. test


-d
-f
-L
-
-W

-
-S

fl -nt f2
fl -ot f2

*
/
/

// , f2
// , 12


si = s2

5/ s2
214
http://itbookz.ru/

si != s2
-z si
-n si

5/ s2
5/
5/


a
a
a
a

-eq
-ne
-gt
-ge

b
b
b
b

a -It b
a -le b

b

b

b
b


tl -a tl
tl - t2
!
\( \)

: // ?
""
: //, t2
""
, ,
""

,

true false

bash true
false, 0 1 .
$true
$echo $?

$false
.
.
$echo $?
1
':'
,
.


215
http://itbookz.ru/

,
.
- if-then.
i f
then

fi
-.,-,...
:
if [ 'whoami4 = "root" ] then
echo " " fi
if-then-else.
if then
! else
2 fi
:
if [ 4whoami" = "root" ] then
echo " " else
echo " " fi
, if-then-el if-else,
, .
if ! then
!
elif 2 then
2 elif ...
else
TenoN fi
:
if [ 'whoami1 = "root" ] then
echo " " elif [ "$USER"
= "root" ] then
echo " , , "
elif [ "$bribe" -gt 10000 ] then
echo
"

,
" else
echo " " fi
case
.
216
http://itbookz.ru/

echo ' ?' read answer case "$answer" in


)
echo "OK, "
)
echo " "
echo " , "
echo " "
esac .
case in 1) !
2) 2

_
- , , ,
$myvar, 1-N - (
info bash reserved case ),
, *, "else"
(). ;;
( ).
case $letter in X)
echo "$letter - X"
[aeiou])
echo "$letter - "
[0-9])
echo "$letter - "
*) ' '
echo " "
esac

while ,
(. . "").
while
do
done
, myscript.
i=0
217
http://itbookz.ru/

while [ $i -It 3 ]' .


do
echo "$i"
i=~expr $i +1' done
$ ./myscript
0
1
2
until ,
(. . ""):
until
do
done
:
i=0
until t $i -gt 3 ]
do
echo "$i"
i=4expr $i + done
$ ./myscript
0
1
2
for .
for in do
done
:
for name in Tom Jack Harry do
echo "$name - " done
$ ./myscript Tom - Jack - Harry -

for ,
.
for file in *.doc do
echo "$file - Microsoft Word" done
while
true ("") until false ("").
218
http://itbookz.ru/

while
echo
until
echo

true do
"" done
false do
" " done

, break exit
, -
.

Break Continue

break .
myscript.
for name in Tom Jack Harry do
echo $name
echo "" done echo " "
$ ./myscript
Tom

Jack
.:

Harry


break.
for name in Tom Jack Harry do
echo $name
if [ "$name" = "Jack" ]
then break
fi
echo "" done echo " "
Tom

Jack
break

continue
.
for name in Tom Jack Harry do
echo $name
219
http://itbookz.ru/

if [ "$name" = "Jack" ]
then
continue
fi
echo "" done echo " "
$ ./myscript
Tom

Jack
continue
Harry


break continue
(break N, continue N) ,
(, N
),
,
.

shell-

shell-,
bash ,
. ,
.
#!/bin/bash

.
:
#!/bin/bash
.
, .
.
$ chmod +x myscript

220
http://itbookz.ru/

, .
.
$ myscript
,
"." ,
"./",
. $ ./myscript
, ,
.
bash bash
.
$ bash myscript
"."

, .*
,
( ,
),
".".
$ . myscript


Shell-
, Linux (,
Linux ).
shell-
$1, $2, $3 . .
$ cat myscript
#!/bin/bash
221
http://itbookz.ru/

echo " $1 $2"

* ()
,
"".

$ ./myscript Johnson Wisconsin


Johnson Wisconsin
$ ./myscript Bob
Bob

$ #.
if [ $# -It 2 ] then
echo "$0 : " else
echo " $1 $2" fi
$0 ,
.
$ ./myscript Bob
./myscript :

,
for $@,
.
for arg in $@
- .
do
echo " $arg" done

exit
.
0 1 (
) .
exit,
0.
if [ $# -It 2 ] then
echo ": "
exit 1 else
echo " $1 $2" fi exit 0
222
http://itbookz.ru/

$ ./myscript Bob
./myscript :

$ echo $?
1

shell-

Shell- , Linux
,
. .

...
Perl
perl man perl
http://www.perl. com/
Python python
man python
http://www.python.org/
C, C++ gcc man gcc
http://www.gnu.org/software/gcc/
Java
javaca
http://java.sun.com/
FORTRAN g77
man g77
http://www.gnu. org/software/fortran/fortran. html
Ada
gnat info gnat
http://www.gnu.org/software/gnat/gnat.html
a He Fedora,
Linux


Linux, . Fedora
.
Linux-. !


(Mike Loukides), O'Reilly, (Ron
Bellomo, Wesley Crossman, David Debonnaire, Tim Greer, Jacob
Heider, Eric van Oorschot), (Alex Schowtka)
223
http://itbookz.ru/

(Robert Dulaney) VistaPrint,


, .


!! ( )
, 52 &
(),
, 55 && ( ),

, 49 .
(), , 28
.. ( ),
, 28 / (),
, 27
/boot , 35 /lost+found
, 35 / , 34,
35 /usr/share/doc , 20
; ( ),
, 48
[ ( ),
test, 260

\ ( )
- , 49
( ), 57
Z ( ), 55
I( ), 48
II(
)

, 49
~ (),
,
abiword , 96 acroread
, 84 Ada , 274
alias , 46 apt , 62 as
pell , 166 at , 241-243 atq
, 243

224
http://itbookz.ru/

atrm , 243 audacity


-,
254 awk -, 133
tr, 127

basename , 72 bash (Bourne


Again Shell), 11, 38-60
printf, 226 type, 110,
117 shell, 256-269
,51
bg , 56
bin , 32
Bourne Again Shell
( bash)
break , 268
bunzip2 , 137
bzcat , 137
bzip2 , 137 . tar j,
159
cgi-bin , 33
chattr (
) , 107
chfn , 187
chgrp , 38,103,191
chmod , 38,103-106
chown , 38,102
chsh , 188
cksum , 140,146
clear , 231
, 140,144
, 140,143
compress , 136 .
tar -Z, 159 .
zip, 138 .
, 60
configure , 65
continue , 269
, 68
cpio , 154
, 243
crontab , 243-246
CUPS
, 163
curl , 216

cut , 123
cal , 236 Calc
(soffice), 94 case , 264 cat
, 75
. tee, 132 cd , 29, 71
,
, 29
cdparanoia , 252 cdrecord
, 159
. xcdroast, 255
date , 237-239
. watch, 240
dc() , 233 (Id
, 154 dev , 33 df
, 148 diff , 140 diffi
, 140,142 dig , 198

dirname , 72
DISPLAY , 44
dnsdomainname

225
http://itbookz.ru/

, 193
doc , 32
domainname , 193
du , 98
dump , 155 .
chattr, 107 . restore,
156
DVI , 85
dvips , 85
echo , 19, 225

, 258 ed ,
133
. diff-e, 142 EDITOR
, 77

, 88 egrep , 121 else
, 262 emacs

lynx -emacskeys , 215



, 51
/
, 86-92
eog
, 247 Epiphany GNOME, 213 etc
, 33 evolution , 207
Excel
abiword,
94
!
soffice, 94
exit , 25
, 273

, 59 ,
268
export , 44
, 231
ext3
, 148 chattr/lsattr,
107
false , 262

, 267 fdisk
, 153 Fedora Linux, 12
up2date , 61
, 19
, 21

, 24 fg , 57
. jobs, 55 fgrep
, 122 file , 100 find
, 110-114 finger , 181,187
Firebird -, 213 floppy
, 153 fonts , 33 for
, 267

, 271
FORTRAN , 274 free , 173
fsck , 151
. shutdown, 26 ftp
, 207
g77 , 274 gaim , 222
Galeon -, 213 gcc ,
2/4 ghostview , 84
DVI , 85 GIMP
, 249 gnat , 274
GNOME , 11 Fedora
Linux, 21 xclock , 235
xscreensaver , 250 -
Epiphany, 213 ,19
/, 25
, 24
gnome-terminal , 24 gnumeric
, 95 gnuplot , 249
Google,
, 21 gqvievv
, 247 grep , 119
egrep, 121 fgrep, 122
ps, 169 RPM-,
62 grip , 252 groupadd ,
192 groupdel , 192
groupmod , 192 groups ,
190
id -Gn, 179 gunzip , 136
gv , 84
DVI- , 85 gzip , 135

226
http://itbookz.ru/

tar -z, 159


, 60

head , 77 -help , 20
history , 52 HOME
, 30, 44 host
, 197 hostname , 194
html , 33
I
id , 179 if , 262
ifconfig , 195 if-then-elif-else
, 263
Impress (soffice), 94
include , 33 info ,
20 init.d , 33
Java , 274 javac , 274
jobs , 55

278

KDE , 11
Fedora Linux, 21
xclock , 235
xscreensaver , 250
- Konqueror, 213
, 20
/
, 25

, 24 Kerberos
/usr/kerberos, 34
telnet, 203 kill ,
58, 174 Konqueror -
KDE, 213 konsole , 24
ksnapshot , 248
last , 182 less , 76
cat, 75 lib , 33
libexec , 33 Linux
, 19
, 11
,
166-167

, 154162
,
27-38

, 60-66 In , 69 lock
, 33 log , 33
logname , 178
LOGNAME , 44 logout
, 25 look , 165 lpq
, 164 lpr , 163 lprm
, 164 LPRng , 163
Is , 17, 66
, 38
, 96 Isattr
, 108 lynx , 214-215

4 , 133 mail
, 33 MAIL , 44
mail , 211 mailq , 207
make install , 66 make ,
66 man , 33 man ,
19,33 md5sum , 140, 145
mesg , 180, 224 Microsoft
Excel

abiword, 94

soffice, 94 Microsoft Word

abiword, 94

soffice, 94
misc , 33 mkdir , 73
mkfs , 153
mkisofs , 160 mnt ., 33
mount , 149 Mozilla -,
213
Usenet, 218
, 207 mpgl23 , 252 mplayer -, 252 mt
, 155 mutt ,
209-211 mv , 68
N

227
http://itbookz.ru/

Netscape -, 213 nice


, 175 nisdomainname ,
193 nl , 79 nslookup ,
198 ntpdate , 239
oclock , 235 od , 80
OLDPWD , 44
OpenOffice.org , 94 Opera , 213
parted , 153 passwd
, 187 paste , 125 patch
, 141 PATH , 4546 Perl , 274 pidof , 175
pine , 207
ping , 199 printenv ,
183 printf , 226-228

, 258 -printf
( find), 113 ps , 168,
175 public_html , 33 pwd
, 72 PVVD , 44
Python , 274
red , 33 rcsdiff ,
141 read , 258 Red Hat Linux,
12 Red Hat Package Manager (RPM)
, 60 redhat-config-printer
, 163 renice , 177 reset
, 58 restore , 156
mt, 155 rm , 69
RMAIL , 207 rindir
, 73 root (/), 27
root , 14, 188 RPM (Red
Hat Package Manager) , 60 rpm
, 60-64 RPM-,
, 62 rsync
, 161 run , 34

280
sbin , 32
scale , 94
scp , 204
sdiff , 140,142

sdraw , 94
sed -, 133
tr, 127 sendmail
, 208 seq , 229 sfax
, 94 sfdisk , 153 sftp
, 205 share , 32
SHELL , 44 shell-
break continue, 268

, 271
, 270

, 273
, 262-265
, 256-274
, 270
, 265-268 shutdown , 26
simpress , 94 slabel , 94
sleep , 240 slocate , 114
, slrn
, 219-221 smpeg , 252 soffice , 94 sort
, 128 spell , 167 spool
, 34 sre , 33
ssh , 201
stat , 96 :
su , 16
whoami , 178
, 189
, 60 sudo , 190
sum , 140, 146 suspend
, 56 swriter , 94 sync
, 108,153
t3d -, 235 TAB ,
, 52
tail , 78 talk , 223 tar
, 158 mt, 155
, 60 tar
, 64 compress,
, 137
gzip, , 136 tee ,
132 telnet , 203 TERM
, 44 test , 259-261 tmp
, 34 top , 171 touch
, 100

228
http://itbookz.ru/

, 87 tr
, 126 traceroute , 200
true , 262
, 267 tty
, 224 twm
, 24
, 24
type , 110, 117
,

umask , 92 umount ,
151 uname , 19, 193
uncompress , 136 uniq
, 130 until , 266
, 267 unzip
, 138 up2date , 61
uptime , 36, 169 Usenet
. V.. 218-221
USER , 44 useradd
, 184 userdei , 185
usermod , 186 users ,
181 u u ! ode , 139
uuencode , 138 uxterm
, 24
var , 33 vfat
, 148 vi ,
87
less, 77 lynx -vikeys,
215
,51
vim ,
87,89
lynx -vikeys, 215
sed , 133 VISUAL
, 77
, 88
W
w , 170 watch , 240
we , 12, 98 wget , 216218 whereis , 117
, which , 116
while , 265
, 267 who
, 179

tee, 132 whoami , 178


whois , 198 Word

abiword, 94

soffice, 94
write , 223 Writer
(soffice), 94 www , 33
XI1 , 33 xargs , 114
xcalc , 231 xcdroast ,
161,255
xclock , 235 xdvi , 85
Ximian Evolution , 207 xload
, 172 xmms , 253 xpdf
, 84 xscreensaver
, 250 xscreensaver-command
, 251
xscreensaver-demo , 251
xterm , 24 xv , 249
xxd , 82 xxdiff , 140
yes , 228 ypdomainname ,
193 yum , 62
zcat , 136 zip , 138
,
, 72
,
, 128 ( & ),
, 55
, 13
, 107
, 108
- Linux, 251-256
(. -)
(.
shell-)

shell-, 258
shell-
( shell-, )
Linux-, 251
, 39, 67, 103-106
Linux-,
258, 273
fg, 57

229
http://itbookz.ru/

,
od, 80 ,
-, 100
, /, 235-239
shell-, 258
, /,
246-251 ,21

, 41

, Linux, 27
, 72
,
35 , 29
, cd,
71
, 31-35
, 73 , 73
, 146-153
(
, )

, 70

TAB, 52

, 59 ,
, 239-246
-, 159, 255
(.
scp)
(. ssh)

, , 114
,
, 57 -,
, 198

,
, 49 , ,
231-235 (.
Linux) ,

, 123
shell-, 271
""" bash
( bash,
) , 38-60
( . bash)
, 40
, 24
, 52
, 59
, 188
, 56
, 55-57 , 12
, 57, 174
, 52
, 48 -,
(. -)
( |) , 48
, , 145

, 59

shell-,
258, 262

,
, 155
, 92
, 49
, 231-235
(.
Linux)

, Usenet, 21,
218-221

Linux, 221-224
),
, 49
, 49
shell-, 256
(. , )
( ), , 24
, ,

230
http://itbookz.ru/

24

(.
) , 12

, ,
173
shell-, 257
, 43
, 44
EDITOR, 77, 88 . . '
, 30, 44
VISUAL, 77, 88
, 183
, - _.
, 190
/ , 48

/, 48
, 239-246
, Linux, 27
, 201-207
, 42

, 179
, 178
,
, 179
, 186
finger, 181 printenv,
183 , 187
:\ , 184
, 14
, 185
(. ,
)
, 39,67,103-106
,
Linux, 165-167
,
tr, 126
,
13
, 14


, 49 shell, 256

, 167-173 , 74-86
-,
212-218
, 167-173
, 174-177
, 147, 153

egrep, 121
find -regex, 110
grep, 119
less , 76
Ku.vuvw slocate -r, 116
awk , 133
Linux, 154-162
,
, 195 , ,
201-207 / ,
134-138 ++ , 274
, 69
,
, 172
, 31-35

286
Linux, 163
, , 49
, 19
, 139-146 , 69
,
, 224-231
, , 88
( ) Linux, 258 , 14
, 189
(. TAB, )
,
, 118-132 (~),

231
http://itbookz.ru/

,
30,43
,
, 100

traceroute, 200
ICMP , 199
, 197
telnet, 203

Linux, 55-57
,
174-177

Linux-, 60-66
Linux, 19
emacs, 89

mutt, 211
vim, 89

, Linux,
27-38
, 96 ,
Is, 66
, 100
, 98 ,
, 68
, 68 , 68
, 109-119 /, 37,
67, 103-107
, 98
, 74-86 , 8695 ,
In, 69 , 86-95

shell-, 265-268
, 235


, 82


xscreensaver, 250
/,
246-251
,
, 207-212

,
rm, 69
, 102
, 104
, (.
) ,
, 55
, 148, 153

232
http://itbookz.ru/