Вы находитесь на странице: 1из 148

5.8.

Shell
,
.bashif then else
case,for,while,until,
.
5.8.1 iftest([])
:
if list1 then list2 else list3 fi

list1,list2 list3,
.,
:{list}.
if ,list1.
,,.
0,list2;,
list3.,if,
,.
if:
if list then list [ elif list then list ] ... [ else list ] fi

(,
).
,if elif,test,
[].test
0,,1
.test.,

test expression,

:
[ expression ].

,test[,
,bash([,
).,testif
.
if:

if [ -e textmode2.htm ] ; then
ls textmode*
else
pwd
fi

test([]).
5.8.2 test
,test,
,.
(""):

-a file

,file.

-b file

,file.

-c file

,file.

-d file

,file.

-e file

,file.

-f file

,file.

-g file

,file.

-h file -L file

,file.

-k file

,file"sticky''bit.

-p file

,file(FIFO).

-r file

,file

-s file

,file.

-t fd

,fd.

-u file

,file.

-w file

,file.

-x file

,file.

-O file

,file,
.

-G file

,file,
.

-S file

,file.

-N file

,file,
.

file1 nt file2

,file1,file2.

file1 ot file2

,file1,file2.

file1 ef file2

,file1file2
(inode).

-o optname

,optname..manbash.

-z string

,.

-n string

,.

string1 == string2

,.===.

string1 !== string2

,.

string1 < string2

,string1string2(
).

string1 > string2

,string1string2(
).

arg1 OP arg2

OP:-eq(),-ne(),-lt
(),-le(),-gt(),-ge().
.

,:

!(expression)

expression1 -a expression2

AND().,.

expression1 -o expression2

OR().,.
while until,
.
5.8.3 case
case:
case word in [ [(] pattern [ | pattern ] ... ) list ;; ] ... esac

caseword,
pattern.
,,,
.,,0,
.,
.
case
/etc/rc.d/rc.sysinit.
case "$UTC" in

yes|true)
CLOCKFLAGS="$CLOCKFLAGS -u";
CLOCKDEF="$CLOCKDEF (utc)";
;;
no|false)
CLOCKFLAGS="$CLOCKFLAGS --localtime";
CLOCKDEF="$CLOCKDEF (localtime)";
;;
esac

yestrue,,
nofalse.
5.8.4 select
select.
:
select name [ in word; ] do list ; done

word,.
,
.word ,.
PS3,
.,
,name,.
,.
,name.
REPLY.list
name.
:
#!/bin/sh
echo " ?"
select var in "Linux" "Gnu Hurd" "Free BSD" "Other"; do
break
done
echo " $var"

,,
:

?
1)Linux
2)GnuHurd
3)FreeBSD
4)Other
#?
4(1,2,3,4).,,1,
:
Linux
5.8.5 for
for,.,

,
.:
for name in words do list done.

(list),if.
.foo_1,foo_2foo_3:
for a in 1 2 3 ; do
touch foo_$a
done

for:
for name [ in word; ] do list ; done

word ,
.name,
list."in word",list
,.
Linuxseq,
,.
for bash,
.for
:
for a in $( seq 1 10 ) ; do
cat file_$a
done

10:"file_1",...,"file_10".
5.8.6 whileuntil
whileif,list2
,,,.
:
while list1 do list2 done.

:
while [ -d mydirectory ] ; do
ls -l mydirectory >> logfile
echo -- SEPARATOR -- >> logfile
sleep 60
done

"mydirectory"
,.
untilwhile:
until list1 do list2 done.

,,
list1,:list2,
list1 .
5.8.7

bash.
,,..
.:
function name () { list }

function,name,
,list,{}.
,name.
,,,
,.
:
().

,
(positionalparameters).$n,
n,.
1,$1.
$*,$#.0.
return,
,.
,#,
.
(local)

,local.
,,
local: localname=value.
,seq:
seq()
{
local I=$1;
while [ $2 != $I ]; do
{
echo -n "$I ";
I=$(( $I + 1 ))
};
done;
echo $2
}

-necho,.
,,
.
fact

:
fact()
{

if [ $1 = 0 ]; then
echo 1;
else
{
echo $(( $1 * $( fact $(( $1 1 )) ) ))

};
fi
}

,.
.

5.9. source
,.
,.
,.
.,
bash,source,
"."..
:
source filename [arguments]

. filename [arguments]

filename
,filename.filename
,,PATH,
filename..,
PATH,,.
,
.,.(),
source,,,
.,filename,
0.

5.10. sh
bash,bashsh.

,
bash.,myscript
"sh myscript".
,(),
,:#!/bin/sh.,
,/bin/sh.
,
.,Perl
#!/bin/perl.
,#.,
,
(..).
,,
#,,"# ls",,
.
bash.,
,,,
,,readline,...
,
manbash.(.13)

6. MidnightCommander

6.1. MidnightCommander

,pwd,ls,cd,mv,mkdir,rmdir,cp,rm,cat,more..,

MidnightCommander,,
.
MidnightCommander(mc),
.
,.NortonCommander
(nc)MSDOSFARWindows,mc,
"".,
MidnightCommander,.
,ncFAR(?),
,MidnightCommander

.

4.5.30,
.


,.
,
,,,
.,""
.

MidnightCommander
.rpm,,
,MidnightCommanderrpm
(,rpm,..10.2).,
,
,.

6.2. MidnightCommander
,MidnightCommander,mc
<Enter>.,,
mc,find / -name mc,
,,/usr/bin/mc.,
NortonCommanderMSDOSFAR
.,DOSWindows.

.6.1.MidnightCommander

MidnightCommander"",
.,
<F9>
(mc,
,).
,
<F1><F10>.
,
,.
,(

,).
.,
10,(
).,,
,
(,
<F9>).
<F1><F9>.
MidnightCommander
(shell),
.()""
(hint4s),,.
,
(,).
,,
"<","v"">",
(,mc).
"",
(,).
(),
.,,
MidnightCommander,,
..
(<F5>)(<F6>),
,().
.
.,

.,
(,
).,
.
6.1. .

<><Ctrl>+<P>

<><Ctrl>+<N>

<PageUp><Alt>+<V>

<PageDown><Ctrl>+<V>

<Home>

<End>

6.3.
MidnightCommander
,<F1>.
,..
..

().,
.6.1,,
:
6.2.

<B><Ctrl>+<B><Ctrl>+<H><Backspace><Delete>

<>

<U>(<D>)

()

<G>(<Shift>+<G>)

()

,
(.6.3).
6.3. .

<Tab>

<Alt>+<Tab>

<>

<>

<><Enter>

<><L>

<F1>

<N>

<P>

<C>

<F10>,<Esc>

<B>.
,
<L>.
(..6.4),
.
.
.

6.4.
MidnightCommander.,
gpm,,Linux
MidnightCommanderxterm(
xtermtelnet,rloginssh).
.
,(),
..

();,
,,
.
,
..
,,
.

,,.

.
Commander,
,<Shift>.
<Shift>,,,
<Shift>,,<Shift>
.,.

6.5.
MidnightCommander
().
.,
.
6.5.1
,,
(Left)
(Right).,
...()
.4:
(Full), (Brief), (Long)
(User).

"",
.
"",
().
"",
"ls -l"..
"",
.

:"half"()"full"
().,.
2.
.
:

name.

size.

bsize,
,"SUBDIR""UPDIR".
type.
,lsF:

*(asterisk);

/(slash);

@(atsign)(links);

=()(sockets)

();

+();

|(pipe)FIFO,

~();

!()(stalled)
(,).

mtime.

atime.

ctime.

perm,.

mode.

nlink.

ngid(GID),.

nuid(UID),.

owner.

group,.

inodeinode.

space.

mark(asterisk),.

|.

,,':',
,.
'+',,,
,.
,"":
half type,name,|,size,|,mtime

"":
full perm, space, nlink, space, owner, space, group, space, size, space, mtime, space, name

,:
half name,|,size:7,|,type,mode:3

(inode);

,
....(.6.2),
,
(
(Reverse)).

.6.2.

,,
" / "("Mixallfiles")
.
,

. ,
,(,"*.tar.gz").
,.
(
"").(<Ctrl>+<R>)
,.,
.
(,.6.10),
,
.
6.5.2
,,
.

" ".(.6.3)
(,
inode).

.6.3.""

" ".
(..6.4).
,,
,
.


.6.4.

" "("QuickView").
,..6.5
.bashrc.

.6.5.""

""
,,<Tab>,
,,.
6.16.2.

"""FTP".
,.
,
.,
,.

6.5.3
,
,.

<Tab><Ctrl>+<i>.().
,,,.

<Alt>+<G>/<Alt>+<R>/<Alt>+<J>.,
,,
.
<Alt>+<T>.
.
(longlisting),
.
<Ctrl>+<\>..
<Home><Alt>+<<>.
().
<End>,<Alt>+<>'>..
<Alt>+<O>.,
,
.,
,
.
<Ctrl>+<PageUp>,<Ctrl>+<PageDown>.mcLinux:
,,(chdir)("..")
.
<Alt>+<Y>.
;'<'.
<Alt>+<U>.;
'>'.

6.6.
MidnightCommander
,.,
.
MidnightCommander
<F1><F10>..6.4.
6.4.


<F1>

<F2>

<F3>

<F4>

<F5>

,,
,.
(.14).,(
,,)

<F6>

,,
,.,
.

<F7>

<F8>

()

<F9>

()

<F10>

()
,
.
,.6.4
,,.
(,
).
,.,
,<Insert>
<Ctrl>+<T>..
.

.
.MidnightCommander,
,. shell
(..6.11),,
shell(..5)." shell",
(.
maned).
(/),
,.

""<+>
.
""(""<><\>)

..
""(<*>),
,,
.
(),
,.
<Ctrl>+<S><Alt>+<S>.
.
,.
(Showministatus),
.
,.
<Backspace><Del>.<Ctrl>+<S>
,.,
,,
,,
.

,,,,
.
MidnightCommander,
MidnightCommander.
,,
.
,
. .
,,
("").

(<Ctrl>+<X>,<C>).
.

/(<Ctrl>+<X>,<O>).chown.

( )..

(<Ctrl>+<X>,<L>)..

(<Ctrl>+<X>,<S>).
..4.4.MidnightCommander
,"@"(
,"~").
(""),
,.
(<Alt>+<C>).,
,().
(<Alt>+<!>).
,(
).
.

, ,
.,,
,.
,.

6.7. /
()
.
,
().
(wildcards),.
,,
/(.6.6).
,,(
).
,(),
.

.6.6.

,/
,,,
| .
(Followlinks),

()
,(),
.
,(Diveintosubdirs),,
,(),
().()
.,
,.
.one
/two/one,.()mc
one/two/one.,
/two/one/one.
(Preserveattributes),
/:,
,root,UIDGID.,
umask.

shell/ .,
(wildcards)'*''?'.
,shell.
'*''\<>'.'*'
,'*'..,
'\1',
'\2'..'\0'.
.
1."*.tar.gz","/two/*.tgz",
"foo.tar.gz","foo.tgz"
"/two".
2.,,
"file.c""c.file"."*.*",
"\2.\1".
shell("Useshellpatterns),mc
.,
,
'\(...\)'.,.

3."^\(.*\)\.tar\.gz$",

"/two/*.tgz""foo.tar.gz","/two/foo.tgz".
4.,,
"file.c""c.file".
"^\(.*\)\.\(.*\)$","\2.\1".
/
.'\u''\l',
()()
.
'\U''\L',
,'\L''\U',
.
'\u''\l','\U''\L'.
,'*'( shell)'^\(.*\)$'
( shell),'\L\u*',
,,
.
'\'.
,'\\'()'\*'
(asterisk).

6.8. MC /

,,Midnight
Commander,,()()
.
(progressbars).(filebar)
,(,).(countbar)
.(bytesbar)
()
. (.
/ ),.
.
,.
,.
.

.
,,
,,.
,,,
(,).
,
,..,
.
()(
).
.("?")
:

( );

,..();

(
).

("?")4
(
):

;
(),
;
(,
);
.

,
.
.
,
. ,
,,
,
,.
,,

.
,
,.
.

6.9.
MidnightCommander,
.
,MidnightCommander
,,
(),
<Enter>.<Enter>,
,,MidnightCommander
,""~/mc.ext.
,,
.
.
(,
,,,,
).MidnightCommander
,
.

<Alt>+<Enter>..

<Ctrl>+<Enter>.,<Alt>+<Enter>,.

<Alt>+<Tab>.""(completion)
,,,(
,),
,
,...
<Ctrl>+<X>,<T>.(
,).
<Ctrl>+<X>,<Ctrl>+<T>.
.
<Ctrl>+<X>,<P>.(..,
).
<Ctrl>+<X>,<Ctrl>+<P>.,

<Ctrl>+<Q>.,
MidnightCommander(,'+').
<Alt>+<P>.
().
<Alt>+<N>..
<Alt>+<H>.(
).

shell,
.,,
,.6.5.
6.5. .

<Ctrl>+<A>

<Ctrl>+<E>

<Ctrl>+<B><>

<Ctrl>+<F><>

<Alt>+<F>

<Alt>+<B>

<Ctrl>+<H>
<Backspace>

<Ctrl>+<D>
<Delete>

<Ctrl>+<@>

,()

<Ctrl>+<W>

,,,

<Alt>+<W>

,,(
)

<Ctrl>+<Y>

<Ctrl>+<K>

<Alt>+<P>
<Alt>+<N>

.<Alt>+<P>
,<Alt>+<N>

<Ctrl>+<Alt>+<H>

<Alt>+<Backspace>
<Alt>+<Tab>

(completion),,,

6.10.

,,
MidnightCommander.
,
.
:
.
,MidnightCommander
.,
,,<Ctrl>+<R>
<F2>.,.
.

.
(..)
<> <> ..
<> <>
.<> ,
<> ,...
(),
.
.

(..6.1).
<Enter>.
.
<Enter>
,
.
<Ctrl>+<R><F2>..,
:
.
<F3>..
.
,.,
<F2>
.
<F4>(Static/Dynamic).()
.
<F5>.(,,
).

<F6>..

<F7>..

<F8>..

<Ctrl>+<S><Alt>+<S>.,
.,
.
<Ctrl>+<H><Backspace>.().

<>.
,.

<Ctrl>+<S>..

<F1>(Help)..
<Esc><F10>..
.

.
<Enter>.
(<Meta>+<?><Esc>,<?>)
.
,
. ,
. (Contents)
egrep.,,
egrep,"\",,"strcmp(",
"strcmp\(".,,
.
.
,<
><>.,
..
.
,
,
(,,,).
<Ctrl>+<R>.
,,
(,,CDROM
,NFS).,
,find_ignore_dirsMisc
~/.mc/ini.
,:

[Misc]
find_ignore_dirs=/cdrom:/nfs/wuarchive:/afs

(. )
,
.
(<Ctrl>+<U>)
.
(<Ctrl>+<O>)
shell.xtermLinux.
(<CtrlX>,<D>),
.
.
.
,,.
(<F5>),
.
().,
mmap(2).
,.
("
"),
(find).,

,
:
[user]$ find . -type l -print

,,.
,
,
.("")
.,.
,
.
.

(<><>,
<Enter>).
<Alt>+<P>
<Alt>+<N>,.
<Alt>+<P>
,<Alt>+<N>
.
(<Ctrl>+<\>),
,
.(),
.
.,
/.
(<Ctrl>+<X>,<H>),
..
,
MidnightCommander(
).""<Ctrl>+<X>,<J>,
,.

mc.ext,(
),(,
).
<Enter>.
(
<F2>).

6.11. MidnightCommander
MidnightCommander(),
,,
.,()
"x".,
/.
.
,.6.7.
,,:"
"," """.

" ".

.MidnightCommander
,'~'(Bls).
.MidnightCommander
,,(ls -a).

.6.7.

.(<Ctrl>+<T>
<Insert>),.
.,
<F9>,(
).
()<Enter>,
,
.
/ .,
.,()
,.
..
,MidnightCommander
:,
inode,..
;inode(,
..).
()(
<Ctrl>+<R>).

.MidnightCommander
,.
.

.,.Linux
xterm,<Ctrl>+<O>.
" " .,
(,
xtermLinux).

..

(Verboseoperation).,
,
,.,
.,
9600bps.
(Computetotals).,Midnight
Commander,

(,
).,
" ".
shell(ShellPatterns).
(Select),(Unselect)(Filter)
,,.
,,:'*'
'.*'();'?''.'(
)'.'(literaldot).,
,man1ed.
.,
MidnightCommander
~/.mc/ini.
.,
.,
(),
.
.,
.,
,EDITOR.,
vi.
.,
.,,
PAGER.,
view.
: .MidnightCommander

""<Alt>+<Tab>,
.<Alt>+<Tab>
,(
),.<Alt>+<Tab>
.
<Alt>+<Tab>,.

.,MidnightCommander
,,
().
lynx.,
<> <>
(,
)..
chown.,
chmodchownchown.
.,Midnight
Commander
,cd.bash.
,MidnightCommandercd
,
,cd ..,
,.
.,
.
""""
""..


MidnightCommander(.6.8).
,,
,,.Linux
(SCO),
.
,,
.

.6.8.

,,
.
,permmode,,
MidnightCommander,,
selected[Colors]~/.mc/ini.
,,(core),
..
,
.
...(.6.9),
(),
(,).

.6.9.

7,7.
"ISO88591"ISO88591, 8
,8
.MidnightCommander
, 8 8 (
.6.9) .
8 ,
KOI8R.
(,cp1251),,
(patch),
MidnightCommander(.http://www.linux.zp.ua:8100/mc/
http://www.sama.ru/~despaire/mc/mypatches.html).
mc.(..10.3).
,,
,,
mc,(
,).
(Learnkeys),
(<F1><F20>,<Home>,<End>),

.
,.,
<Tab>,vi(<h>,<j>,
<k>,<l>).,
OK,
.
.
,OK.
.,
<F1>OK(
),.
.<Tab>.
,OK.
,
(),.
(
<Tab>)<Enter>.,
,.
<Esc>,.
,(
).,
[terminal:TERM]~/.mc/ini(TERM
).
,,,.
,
,.
ini
.
,
MidnightCommander.,
..12CoolEdit
MidnightCommander.,,
<F1>.(bzip2)
http://linuxve.chat.ru.,
/usr/lib/mc,mc.hlp,<F1>
.

7.

Linux,,
,
"".
,,.

,,
,,(
)(,,),
,
.
,Linux,
.
MicrosoftWindows,
.,.

7.1.XFree86
LinuxXWindowSystem(,
Window,Windows)"X"(""),
1987.
X,1988.
UNIX.1997X
XOpenGroup(http://www.x.org).11
6UNIX,
X11R6.
X11R6UNIX
80386/80486/Pentium(Linux),
(DavidWexelblat).XFree86
(http://www.xfree86.org),Linux,SystemV/386,
386BSD,FreeBSDUNIXIntelx86.
4XFree86,,3
Linux.
XWindow"/".,
"".,X
("")
.X"":

,.,
,.

(,),
X,(XNetworkProtocol).,
,X,
()X.
X,"".
X,
..!
.
,.
X.
<Ctrl>+<Alt>+<Backspace>(
),<Ctrl>+<Alt>+<+><Ctrl>+<Alt>+<>""
,<Control>+<Alt>+<F#>
.
,X
,,
.""X,
XWindow,GIMP,CorelWordPerfect,
xterm.

:Xlib(.7.1).XLib
,
.XLib
.
X,.
:,,,
,
.

,.
XFree86,
.,
.
Motif,CDE,KDE,GNOME,GNUStep..
XWindow,.KDE,

,QtXLib.Motif
.GNOMEGTk+,
GIMP.,GNOMECORBA(TheCommon
ObjectRequestBrokerArchitecture
)Imlib
.

.7.1.Linux1
,
,.,,
,.
XWindowMS
Windows.
,Linux(UNIX)
,MSWindowsOS/2.
,,.
,..,MidnightComander'..
,X.
X(TCP/IP,
,XX).
Xlib.,,,
X(DISPLAY,
).,,X
(,emacs),
.
,.7.1.,,
Xlib
TCP/IP.,
TCP/IP..
X,,
,.

.XFree863,
,.,
XF86_Mono;XF86_S3,
S3;XF86_S3VS3ViRGEViRGE/VX;XF86_SVGA
,SuperVGA.X

http://www.xfree86.org/.
XFree86X,
XFree86/usr/X11R6/bin/.
X,XX.
,
..

fvwmFreeVirtualWindowManager.
fvwm2fvwm,,,
.FVWM
FVWM2http://www.hpc.uh.edu/fvwm/.
fvwm95Windows95.
IceWM(http://berta.fri.unilj.si/~markom/icewm),
(,OS/2Workplace
Shell),,,.
Enlightenment(http://www.Enlightenment.org)
.

Motif,UNIX
,LessTif(http://www.lesstif.org),XviewLinux
OpenLookSun.
(WindowMaker,IceWM,FLWM,FailSafe)
.[1.6].

.
XWindowX.
,,
Linux.,
"".
.,,
()
.
KDE(http://www.kde.org)GNOME(http://www.gnome.org).
KDE(KDesktopEnviroment)
QtTrollTech(http://www.trolltech.com/).
kwm,
kfm,KDE(Windows)

,KOffice.,
.
,
.,

(,,).
2.1KDEKonqueror,
.,
,,
InternetExplorerNetscapeNavigator.
,KDE,GNOME(GNUNetwork
ObjectModelEnvironment),GNU,,
(KDE
,Qt
GPL;KDE).
GNOMEGTK+.
,,,
,KDEGNOME,,Xfce(http://www.xfce.org),dfm
(http://wwwc.informatik.unihannover.de/~kaiser/dfm/dfm.html).
Linux
.
Linux(,RedHatLinux7.1)
,
.
XWindow,,
.,
,,
.
1J.BarrLinuxWorld(http://www.linuxworld.com/lw199904/lw04vcontrol.html).

7.2.
,
.,
,,
.."FAQ
Xfree"(http://knot.pu.ru/faq/xfaq.html).
(
,,).

,.
.
:,
.,
(),()
.
.
:(RGB),(HS),
(VS).()
,()
.
()
X.
.
(VSF)(Hz)50
180.(HSF)(KHz)
31135.
,..

.()
.
.
:,,!
,
.(
,).
"thecard'sdotclock".
,DCF(dotclockfrequency).
(
SRRscreenrefreshrate).,
,.
60.
VESA72.
,
,(DCF),
.,

,..
.,

,
,
(,).
(HFLHorizontal
FrameLength)(Vertical
FrameLengthVFL),.
HFL=( )+( )+(
)+( , ).
VFL
:
SRR=DCF/(HFL*VFL).
(SRR=VSF)
,.,

.
.
,
.
:(R),(G)(B).
.
,
,
.,
RGB,
.
,,,
,
.,
,,
.
,
,:( ),(
)*( )*( ).
,1024*76816
(4),1024*768*4=3145728.
2,,
.
.

,,
.

7.3. X
,Linux
,,.
,,
.
.
,.,,
.8.2.5.
,,,,,
Linux
.,XFree86,,
,.,XFree86,(
,,.10).
,,
.

Xfree86,,
.
,,,,
!,,!

7.3.1
,:

(;
,);
,(X
,);
;

(;
).

XWindow
.,
,X

.
SuperProbe(
,,sprobe.txt):
[root]# SuperProbe > sprobe.txt

(<F3>MidnightCommander),
.,,
SuperProbe
Chipset: S3 Trio64 (Port Probed)
Memory: 1024 Kbytes
RAMDAC: Generic 8-bit pseudo-color DAC
(with 6-bit wide lookup tables (or in 6-bit mode))

Chipset: Trident 3DImage985 (PCI Probed)


Memory: 4096 Kbytes
RAMDAC: Trident Built-In 15/16/24-bit DAC
(with 6-bit wide lookup tables (or in 6-bit mode))

,XFree86.
,Linux,
./etc/X11/
X:
@X -> /usr/X11R6/bin/XF86_SVGA (3XFree86).
@X -> /usr/X11R6/bin/XFree86 (4XFree86).

/etc/X11,X,

[root]# ln -s /usr/X11R6/bin/XFree86 X

(,/usr/X11R6/bin/XFree86).
7.3.2 /etc/X11/XF86Config
X/etc/X11/XF86Config(3XFree86)
/etc/X11/XF86Config4(4XFree86),
X.

,X,:
/etc/X11/XF86Config4
/etc/XF86Config

/etc/X11/XF86Config
/usr/X11R6/etc/XF86Config
<XRoot>/lib/X11/XF86Config,

<XRoot>,XFree86(/usr/X11R6).

XF86Config.X
Window(,,
!),.
XFree86Linux,,
.3XFree86,
Xconfigurator.4
xf86config xf86cfg, configureX
.:
[root]# /usr/X11R6/bin/XFree86 -configure

,,
/root/XF86Config.new./root/XF86Config.new,
(4XFree86,
.).
Section "ServerLayout"
Identifier "XFree86 Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
ModulePath "/usr/X11R6/lib/modules"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/CID/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection

Section "Module"
Load "extmod"
Load "xie"
Load "pex5"
Load "glx"
Load "dri"
Load "GLcore"
Load "dbe"
Load "record"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "PS/2"
Option "Device" "/dev/mouse"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection

Section "Device"
Identifier "Card0"
Driver "trident"
VendorName "Trident"
BoardName "3DImage985"

BusID "PCI:1:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Depth 8
EndSubSection
SubSection "Display"
Depth 15
EndSubSection
SubSection "Display"
Depth 16
EndSubSection
SubSection "Display"
Depth 24
EndSubSection
EndSection

Section "DRI"
EndSection

,XF86Config,:
Section "_"
Identifier "Name"
SectionEntry
...
EndSection

,"#",.
.:

ServerLayout;

InputDevice

Screen;

Device;

Monitor;

Modes;

Files;

ServerFlags;

VideoAdaptorXv(man,

,,!);
Module;
DRIDRI;
Vendor(Vendorspecific
configuration).

,
().
ServerLayout,..
XF86ConfigX.,/
X.,
InputDevice().
(
),Screen,
ServerLayout.,ServerLayout,,
:
Section "ServerLayout"
Identifier "MainSection"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Screen
.:
Section " Screen"
Identifier "Screen0"
Device "Trident 3DImage985 (generic)"
Monitor "ViewSonic|ViewSonic G771"
DefaultColorDepth 24
Subsection "Display"

Depth 8
Modes "1024x768" "800x600" "640x400"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 32
Modes "1024x768" "800x600" "640x480"
ViewPort 0 0
EndSubsection
EndSection

,(
Device"MatroxMilleniumG200")(Monitor
"Monitor0").
CScreen(Subsection)Display,
.
,.Modes.
,Monitor(,
Modeline).
.,
(),<Ctrl>+<Alt>+<+>
<Ctrl>+<Alt>+<>(<+><>).
,
."Virtualxdimydim",xdimydim
.,800*600,
1024*768.

.,,,
,,,
,
,3040%
.
Monitor,
,Monitor,
:
Identifier "Unknown"
VendorName "Unknown"
ModelName "Unknown"

,
.
:
HorizSync 3070

VertRefresh 50180

:
HorizSync 31.5, 35.2
VertRefresh 60, 65

:
HorizSync 1525, 3050

VertRefresh 40-50, 80100

,
().
!
,,,
.

Monitor,
().4XFree86
,X
VESA.Monitor
,,,
,.,
Monitor,.
Modes.

.,
Monitor,UseModes.
:
.:
Modeline "640x480example" 25.175 640 664 760 800 480 491 493 525 -HSync +VSync
Mode "640x480example"
DotClock 25.175
Htimings 640 664 760 800
VTimings 480 491 493 525
Flags "-HSync +VSync"
EndMode

(ModelineMode),EndMode,.
X,
.().
(,[9.1],"
,").
()(
).
(Htimings),,,
,..
,,
(,
),.
.
(
).
,
.
,
().,,
,
(,
).
4(VTimings),
()
().

(Flags),
,.
ModesUseModes,
,VESA.
X,
(,
HorizSyncVertRefreshMonitor,,
).
Device,.,
.:
Driver "mga"

(Chipset);
();
(dotclocks)
;
RAMDAC(RAMDAC,
).

,,,
.
,
.,
(,),
.
SuperProbe,,
Device.
InputDevice(3XFree86
InputDevice:KeyboardPointer).,
.,
"Generic102keyPC(intl)""Generic101keyPC".
104,,
:
Option "XkbRules" "xfree86"
Option "XkbModel" "pc104"
Option "XkbLayout" "ru"
Option "XkbOptions" "grp:ctrl_shift_toggle"

(<Ctrl>+<Shift>).
,(XqueueStandart),
(therepeatrate),.
,,.
.9.3.
InputDevice.
2():
Option "Protocol" "PS/2"
Option "Device" "/dev/mouse"

.
(""),Protocol"PS/2",
,"PS/2".
,.,
.,
LogitechMouseMan,Microsoft.
,"Auto"Protocol.
Files,(
,,
).
.,
(fonts.dir,
mkfontdir,).
"Can'topendefaultfont'fixed'"
,,Files
().
,.
,Module,
,ServerFlags,VideoAdaptor,DRI,Vendor.
,.
7.3.3/etc/X11/XF86Config
,,XF86Config,X,
,,(X),
/etc/X11/XF86Config.,
,
.
,/etc/X11/XF86Config

Xconfigurator3XFree86:
[root]# /usr/X11R6/bin/XFree86 -configure

4XFree86.
/root/XF86Config.new.
[root]# XFree86 -xf86config /root/XF86Config.new

X,.
/etc/X11XF86Config4.
,/etc/X11/XF86Config4.
X(,
,,X
,,).
X,,,,
.7.4.
,
,<Ctrl>+<Alt>+<Backspace>(
,,
X,,,).
,
;
<Ctrl>+<Alt>+<Backspace>,,
.
,
,c.
,,,
.
[root]# X -probeonly > probe.log 2>&1

Xprobe.log.
,
,probe.log.
,X
Window(,/var/log/XFree86.0.log
,,probe.log).probe.log
XFree86Linux.,
(/var/log/XFree86.0.log),
(,,
?,.).
(==) Log file: "/var/log/XFree86.0.log", Time: Mon Feb 12 17:20:25 2001

(==) Using config file: "/etc/X11/XF86Config-4"

probe.log,
:

,;
(**) ,(
/etc/X11/XF86Config4);
(++) ,;
(==) ,;
(II) ;
(WW);
(EE) .
(--)

,,
/etc/X11/XF86Config4.probe.log,
(,
):
(**) |-->Screen "Screen0" (0)
(**) | |-->Monitor "Monitor0"
(**) | |-->Device "Card0"
(**) |-->Input Device "Mouse0"
(**) |-->Input Device "Keyboard0"
(**) FontPath set to "unix/:-1"
(**) RgbPath set to "/usr/X11R6/lib/X11/rgb"
(**) ModulePath set to "/usr/X11R6/lib/modules"
(--) using VT number 7

,,:
(II) Loading /usr/X11R6/lib/modules/fonts/libbitmap.a
(II) Module bitmap: vendor="The XFree86 Project" compiled for 4.0.2, module version = 1.0.0

,,(EE),
.,:
(WW) MGA(0): Monitor0: Using default hsync range of 28-33kHz
(WW) MGA(0): Monitor0: using default vrefresh range of 43-72Hz

:
(WW) MGA(0): Default mode "1856x1392" deleted (hsync out of range)

,X.


.,.
.

[root]# X -probeonly > probe.log 2>&1

probe.log,,(
,1600*1200).
probe.log(,,
):
(--) MGA(0): Virtual size is 640x480 (pitch 640)
(**) MGA(0): Default mode "640x480": 25.2 MHz, 31.5 kHz, 60.0 Hz

()
(**) MGA(0): Depth 24, (--) framebuffer bpp 24

,(,)
24"640x480"60.
,
/etc/X11/XF86Config4..,.
.,,
.
/etc/X11/XF86Config4Display
Screen.
DefaultColorDepth24
Screen.,,1024x768,
DisplayScreen
Modes "1024x768"

("640x350","640x400","640x
480","800x600","1024x768","1152x864","1280x1024","1600x1200"..).
Display,
DefaultDepth(DefaultColorDepth).
[root]# X -probeonly > probe.log 2>&1

,,,,
X.
,
.,
<Ctrl>+<Alt>+<Backspace>


[root]# X -probeonly > probe.log 2>&1

,
.
"1024x768".
.,,
"1024x768",
"800x600",
,.
ModelineMonitor
..,
,xvidtune(
).("Show"),,
:
# 1024x768 @ 85 Hz, 68.31 kHz hsync
Modeline "1024x768" 94.5 1024 1072 1168 1376 768 769 772 808 +hsync

Modeline.,,
(DotClock)94.5.
94.
84,55,,,.,
,xvidtune.,
.
xvidtune.
.,
.startx
xvidtune.:

.7.2.xvidtune

,,XFree86ProjectInc.
.,,
!,
,(
,).,
,.,!

(OK)xvidtune
(.7.3).

.7.3.xvidtune

.
,Right(
),Apply.,.
(Left),(Up)(Down).
(Wider)(Taller),,
(NarrowerShorter).
,R
Restore.,
,
.Fetch
.
Auto,..Auto(,
..)Up/Down/Right/Left
Wider/Narrower/Shorter/Taller(Apply)
.
Test.Show
,(
,).
"Modeline",..,XF86Config.Next
X,Prev
("Modes").
,
,.
.
,"Modeline".
ShowQuit.
,"Modeline"
XF86Config.
,,
PixelClockxvidtune.
xvidtune.,

,
.:

(HTimings),xvidtune.
DotClock,"Modeline".
,
.
"Modeline".
(),,
,
..,
.,,Display
.XF86Config
,8.Screen
,,()
.
,,
DefaultColorDephtScreen,:DefaultColorDepht 24.
,Screen,,
XF86Config,.
X
.

7.4. XWindow.
XWindow.
.
,.,
(3XFree86),X
,
.?
,X.
,
/usr/X11R6/bin.,
.,
.
<Ctrl>+<Alt>+<Backspace>,X.
()
,xinit.

xinit(/usr/X11R6/bin)
XWindow.
,X,xinit
.xserverrc,
.,xinit:
X :0

..X 0.,
,,X.
,..xserverrc,
,execX.
.
xinit,
,xinit.xinitrc,
,.
,xinit:
xterm -geometry +1+1 -n login -display :0

RedHatLinux.xinitrc,
xinit,
.,
(,..),,
.,,/usr/X11R6/binfvwm
twm().
,(,
),
.
,
(
).,
.xinitrc.
.xinitrc,,
"".
#!/bin/sh
xrdb -load $HOME/.Xresources
xsetroot -solid gray &
xclock -g 50x50-0+0 -bw 0 &
xload -g 50x50-50+0 -bw 0 &

xterm -g 80x24+0+0 &


xterm -g 80x24+0-0 &
twm

,,.xinitrc,,
.
.(
),,
(
xinit,xinit).
,,
XExittwm.
,xinit,
.xinitrc.xserverrc.
/.
xinit.X,
(),
.
(/)(.).
,
().,
(,),.

,xinit
.
.
xinit.
[user]$ xinit

,()X,
.xinitrc,,xterm.
[user]$ xinit -- /usr/X11R6/bin/Xqdss :1

,.
[user]$ xinit geometry =80x65+10+10 -fn 8x13 -j -fg white -bg navy

,X,
xterm,.
.xinitrc.
[user]$ xinit -e widgets -- .Xsun -l -c

.Xsun -l -c,
xterm-e widgets.

.xinitrc,
,,.
x11,xstart,startx
.:
#!/bin/sh
xinit /usr/local/lib/site.xinitrc -- /usr/X11R6/bin/X bc

RedHatLinux
startx,/usr/X11/bin().
man,,
,
.
startx,,
:
xauth add $display . $mcookie
xauth add `hostname -f`$display . $mcookie
xinit $clientargs -- $display $serverargs

,,startxxinit,
.
xinitrc,.xinitrc,
(),,
/etc/X11/xinit/xinitrc,.."clientargs"="/etc/X11/xinit/xinitrc".
serverargs:.xserverrc
,serverargs.
,serverargs/etc/X11/xinit/xserverrc.display
:0.startx,
(,
),,xinit
auth $HOME/.Xauthority.,(
.xinitrc.xserverrc)
:
xinit /etc/X11/xinit/xinitrc -- :0 /etc/X11/xinit/xserverrc -auth $HOME/.Xauthority

xauth-auth $HOME/.Xauthority,X,
,.
,(,.

manXsecurity).

7.5.
,XWindow,
.,
.,
.,
.xinitrc:
#!/bin/sh
# $HOME/.xinitrc
usermodmap=$HOME/.Xmodmap
xmodmap $usermodmap
xset s noblank #
xset s 300 2 # screensaver- 5 .
xset m 10 5 #
rxvt -cr green -ls -bg black -fg white -fn 7x14 \ -geometry 80x30+57+0 &
if [ "$1" = "" ] ; then WINMGR=wmaker # WINMGR=wmaker
else WINMGR=$1
fi
$WINMGR

,
[user]$ chmod +x .xinitrc.

.xinitrc,,:
[user]$ startx startkde

,
,.xinitrc,
:
#!/bin/sh
. /usr/local/lib/site.xinitrc

7.6. KDE

,(,,

).,
()
.

.
GUIGraficalUserInterface,...
,,GUI.GUI

,,
.,,
,GUI
.
,,
.KDE
GNOME.KDE.,,
,,.
GNOME.,
GNOME,
KDE.
.15KDE.
,,KDE
startx.(,BlackCatLinux6.02)
GNOME..
,,startx
xinit,/etc/X11/xinit/xinitrc
()./etc/X11/xinit/xinitrc
Xclients,
/etc/X11/xinit/Xclients:
if [ -f $HOME/.Xclients ]; then
exec $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
exec /etc/X11/xinit/Xclients

,,/etc/X11/xinit/Xclients,,
,/etc/sysconfig/desktop.
,:
KDE(cat > /etc/sysconfig/desktop).
:
KDE.,,.15KDE

(http://www.kde.ru).

7.7.
XWindow,
,(XDisplayManagerxdm).
,
startx.
,<Ctrl>+<Alt>+<F#>,
,<Ctrl>+<Alt>+<F7>.
,xdm,/etc/inittab.

id:3:initdefault:

(.8.2).
:
id:5:initdefault:

Linux5.
/etc/inittab
x:5:respawn:/usr/bin/X11/xdm nodaemon,

,xdm.
xdm,,24
8bpp(
),/etc/X11/xdm/Xservers()
:
:0 local /usr/X11R6/bin/X -bpp 24

KDE,xdm,,kdm.BlackCat
Linux,,/etc/inittab,,:
x:5:respawn:/etc/X11/prefdm nodaemon,

/etc/X11/prefdm/usr/bin/kdm.
:
,respawn,
.,""<Ctrl>+<Alt>+<Del>
.xdm
XWindow,
.,,
/etc/X11/XF86Config,
<Ctrl>+<Alt>+<Del>,.
,,

(,.8.2).

8.

,,
.
,,
.,,,
root.
,
Linux:
(),
.,(..,)
.,Linux
(linuxconfprinttool),
.
,Linux(UNIX)"
".,
Linux.
,,
LinuxMidnightCommander.
,
(,
).

8.1. .

:

;
;
();
;
;
;
.

,
.

.
,.,
.
,,
.

,,
.
,
.,,"
".,Linux,
.,
("")
.""(""),
""("").
"",pstree.
,""("
")init,.
PID,
.1init.
.
:(R),(T)""
(S)..

():

;
;
(
);
;
,..
;
,,
;
;
(umask),
,
().

Linux,
.,"",
.(
, , Linux
, ,
).

.,,,
.,,
,,
.
"".
.
<Ctrl>+<C>,,
"".,
.,
.,,
"".""init,
.
,""
Z.(..
),.
.,
"",.D.
.
..
,,.
,
,.
,("")(thread),
.,Linux
,.
,,
.
(
.8.4).

8.2. Linux
,,,
RedHat.(,Debian)
.
8.2.1.init /etc/inittab
,
BIOS.
(,lilo),,
,,vmlinuzx.y.za
/boot.x.y.z,a
.,,
,
.
init.
init,,
,,
.Init
,:
,(),,
..
(runlevel).
,init,
,...
.Linux8:

0;
1();
2NFS(,3,
);
3;
4;
5;
6;
S(s),,Ss
.

,0,16.,
25,.
,,

,,..
,.
,
.
init/etc/inittab.
.#,
.4,:
id:runlevels:action:process

id.,14

.inittab;

runlevels,.

,,345;

process,.

,
;

action.

action,
,process.action:

respawn;

once;

waitinit

,,;

sysinit,

(runlevels).,
,,bootbootwait;

boot

bootwait

,init;

initdefault,action,

,.process
.,,,
init,,,
;

off;

powerwaitinit,.

,
(UPS),UPS
init,;

ctrlaltdelinit,

<Ctrl>+<Alt>+<Del>.,

<Ctrl>+<Alt>+<Del>,(
,).
.inittabman
init(8),inittab(5)getty(8).
/etc/inittabinit
(1),root,
.init,,
:
id:3:initdefault:

,,
,initdefault 06.
init,sysinit.
rc.sysinit/etc/rc.d.init
/etc/inittab,
(1),(),
.,,
rc/etc/rc.d.(..
,),
,,
,3
l3:3:wait:/etc/rc.d/rc 3

,rc.sysinitrc,.8.2.2,
init.
,(25)
(getty),
.init,getty
("gettty"),,
.getty,
setpgrp,

open,
.open,getty
login(),,
.
,login,,shell
.shell"loginshell"(
shell,).,shell,
,getty,loginshell,
.
,
,,
initgetty,,
.
init,
.,telinit,
,init,
/etc/inittab.HUP;
,
.
,init
/etc/inittab
,,
.
(shutdown),init
,
.

.maninit
(8),inittab(5)getty(8),"LinuxDocumentationProject'sSerialHOWTO".


/etc/inittab,.

8.2.2.
.8.2.1(/etc/inittab),,
initgetty2

rc.sysinit/etc/rc.d;
rc/etc/rc.d,
(rc3).

rc.sysinit,
,(loadkeys)
(consolechars),,
,..
shell(.5),
/etc/rc.d/rc.sysinit.
,rc,
/etc/rc.d.,
(shell),
.
rc.d:

rc0.d
rc1.d
rc2.d
rc3.d
rc4.d
rc5.d
rc6.d
init.d

(,ls -l)rcX.d,
,,,
,(),/etc/rc.d/init.d.
,K,S.
init.d(NFS,sendmail,
httpd..).
,initrc.sysinitrc,
.
.
,.
rc.X
rcX.d,K,,
,stop,..(
).,

.
,S,start.
,()SK,
rcX.d,startkill,.,SK
,.
SXXname,rc25,
/etc/rc.d/rc.local.,
,,

,.
,,
:/etc/issue
/etc/issue.net,,.
8.2.3. ,
/etc/inittab,/etc/rc.d/rc.sysinit,/etc/rc.d/rc,/etc/rc.d/rc.local(,
,),
,,
.,
.
/etc
.
,.

/etc/lilo.conf,lilo(
.2);
/etc/modules.conf(/etc/conf.modules),
(.manmodules.conf);
/etc/fstab,
(..4.8.8.3);
/etc/passwd,;
/etc/profile$PATH
;,,
/etc/profile.d,,,;
/etc/bashrcbash,()
,..;
/etc/issue,(

);
,
/etc/rc.d/rc.local;

/etc/motd,
();
/etc/redhatrelease,
rc.local.

.,
,
..
8.2.4. ,
.
1. login:getty.
2.

gettylogin,.

3.

login/etc/passwd.

4.

login/etc/motd"".

5.

loginshell,

6.

shell,

TERM.

.
.
,,
"".Bourneshell,
.profile,Cshell.login.cshrc,Kornshell.profile.kshrc(
bash).
(PATH),
,,,
,,,
,,
:
/home/your_home/.bashrc(..
,,
);

/home/your_home/.bash_profile/home/your_home/.profile
.
(,),
,,,.
,,
~/.profile..
.,,
:
if test $USER = jim; then
echo ', Jim!'
fi

8.2.5.
,,,.,
.,
[10.1]:

;
,,,
;
;
(,
);
(,,,
).

,,
,.

,..1(..8.2).
,fsck
.
fsck/usr,,,
,.
,
.
init,

(LILO boot:)single
emergency.,,
LILO boot:

linux single root=/dev/hda1.

/dev/hda1,,.
.

(systemservices)
login.(,
telinit,,
,).

root.,
,LILO,
root.

,lilo.conf:
restricted
password=<password>

,
..
.[1.9],,
SCSI.,,Linux,
(.),SCSI,
,initrd.,
,
,,.
,,,
.,
,.

8.3.
,,,
.
,,.

8.3.1. /etc/fstab
.
.()
mount,.4.8.
/etc/fstab,
.4.8.,,
,
.
LinuxWindows
(CDROM,Zip
Iomega..).
.,
,
,/etc/fstab.

,
,.
(),
:,CDROM,ZIP,,
NFS.MidnightCommander:
[root]# cd /mnt
[root]# mkdir floppy; mkdir cdrom; mkdir win; mkdir zip; mkdir server

/etc/fstab,,
,(,,):
/dev/fd0 /mnt/floppy vfat user,noauto 0 1
/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto 1
/dev/sda4 /mnt/zip vfat user,noauto,exec 0 1
/dev/hda1 /mnt/win vfat user,noauto 0 1
server:/export /mnt/server nfs defaults

/etc/fstablinuxconf,
(Filesystems|Accesslocaldrive).
/etc/fstab,CDROM
.KDE

.
MidnightCommander,(/usr/lib/mc/mc.mnu)

.:
m
mount /mnt/floppy
d
umount /mnt/floppy

(,/etc/fstab,
/mnt/floppy).MidnightCommanderLinux
NortonCommanderFAR
MSWindows:,,
<F2><M>,<F2><D>.
8.3.2.
,,Linux,
()
.(swaping).Linux
,:

(swap);

(swappartition).

,
,.,
,
.,
,.,
,,,
.
.
,,.2.
dd:
[root]# dd if=/dev/zero of=/swapfile bs=1k count=size,

size.
size40131073,,
133890048(128).
.
2(,
).
,cp,

,
.
(,)
,mkswap:
[root]# mkswap c swapfile [size]

[root]# mkswap c /dev/hdb3

c.
,.
Linux.
mkswap,p.,
,40968192.,mkswap
,10,,
40.
mkswap,
,(
).
swapon.
/etc/rc.d/rc.sysinit.,
.swapoff.
,
.
Linux(8).
,swapon s
/proc/swaps.
8.3.3.
.8.2,,,
/etc/rc.d/rc,,
.
,/etc/rc.d/rcN.d,N
./etc/rc.d/rcN.dKNNnameSNNname,
NN,,name
(,,
,)./etc/rc.d/rc
(NN),
KNNname.stop,..

.
SNNnamestart.
WebApache.
,
,,.
SambaFTP,.
.
,.
(apache1.3.19
3.i586.rpm).
[root]# rpm Uhv apache-1.3.19-3.i586.rpm

.
.
Apache.,
"",,.,,
.
/etc/rc.d/rcN.dhttpd:
[root]# ln s /usr/sbin/httpd SNNapache

NN(
,,,98).
Apache.
,SNNapache
/etc/rc.d/rcN.d.
,()
.chkconfig.list,
,,
.adddel
/etc/rc.d/rcN.d:
[root]# /sbin/chkconfig [--add | --del ] name

:
[root]# /sbin/chkconfig [-- level levels ] name [on | off | reset]

apache
[root]# /sbin/chkconfig --level 345 httpd on

8.3.4.SystemVInitEditorksysv
KDE

.ksysvSystemVInitEditor
,,
.,
.8.1.
7,,
(
)..
,.
,
(.8.2),(.8.38.4)
,,
.
Service4(8.2),
,(Restart),
.,,,,
.,,
,,
.
.

.8.1.ksysv


.8.2.

.8.3.General


.8.4.Permossions

.,
.,,,
?

8.4.
,.Linux(
UNIX)ps.,
,.
,,-ax.
8.4.1. ps
man,ps,,
.,GNU,Linux,
UNIX.Unix98
,().BSD
,.,GNU
,.,
.,
:

ps [-]
ps []
ps [-- __ [-- __] ...]

.
.
.
ps,
.:

USER;

PID;

PPID;

%CPU(),
;

%MEM(),;

VSZ();

RSS(1K);

STIME;

TTY,;

SSTAT;

PRI;

NInice(.nice);

TIME;

CMDCOMMAND,
;

,man,
ps.
,.
,,:

R,,
;

S"";

D;

T;

Z.

W;

<;

N;

L,.

,.
psaxA.
CMD:
,.
ps.
,,
.
,:
[user]$ ps e

o,,
:
[user]$ ps eo pid,user,cmd

,,BSD:
[user]$ ps ax

,,
"":
[user]$ ps ef

,,"""",
ps ef pstree.
,,%:
[user]$ ps u

nice,l:
[user]$ ps l

8.4.2. top
ps"",.

pstop"
".8.5,
top.

.8.5.top

,,,
,,
,,,.
,.,
,:,.
,ps(..8.4.1),
.
5.
(),,PID,
.,
top.(,
,Shift):

<Shift>+<N>PID;
<Shift>+<A>;
<Shift>+<P>;
<Shift>+<M>;
<Shift>+<T>.

,,top,
.<K>
(PID),<R>
nice.,
killrenice,.8.4.3..8.4.4
8.4.3. , nice renice
,,,
.,
."nice",
+20(,,
),20().
nice

.nice,nice
.:
nice [- adnice] command [args]

adnice(20+19),nice.
nice.
.adnice,
nice,10
nice.,,
,
.
,renice,nice.
:
renice priority [[-p] PID] [[-g] grp] [[-u] user]

,
[root]# renice -1 987 u daemon p 32

1PID98732,
daemon.
.
,
.
(nice),,
nice,.
"".
8.4.4. kill
,
.,
.
,,
,.Linux63
,
[user]$ kill l

.
SIG,:,1
SIGHUP,HUP.
,.

,.
,
. .
,,
.
.
.
,
.
,
.
.8.1..
8.1.

HUP

Hangup.

INT

Interrupt.
,

<Ctrl>+<C>
<Del>

QUIT

,Interrupt

<Ctrl>+<\>

ILL

IllegalInstruction.
(
,).
,

FPE

FloatingPointException.,
,

KILL

11

SEGV

SegmentationViolation.

13

PIPE

FIFO,
,

15

TERM

SoftwareTermination.

()
17

CHLD

18

CONT

19

STOP

20

TSTR

,.

<Ctrl>+<Z>

,
..kill,
.,
,-l.
,,
,.
()kill
:
[user]$ kill [-] PID [PID..]

,,15
(TERM).9(KILL),
.
"",,
.TERM
QUIT,"".
,kill.
,(
ps<exiting>),,
..
,.
.
8.4.5.
,
,,"".,""
,,
.,.

&.
bash,
.,
,jobs.
,shell.
.
:stopped(),running()suspended
().,.
+,-.,
+,fgbg,
.,,+,
,+.
fgbg,
.
,jobs.
,,+.fg
,bg
.bg,
.
8.4.6. nohup
,bash,
..
"",
,.
,
,nohup.:
nohup &

(
,..8.1).
nohup.out$HOME/nohup.out.
nohup,,nice
5,..
.

8.5.

.,,
.,,Linux
.
,,
().,
,rootuser.
.
,
.
,
..
,:

;
;
;
;
,,.

.
,
/etc/passwd.
,:

;
;
UID();
GID();
(,);
;
shell.

GID,
().
UID.
,
/etc/group.
,(*),
/etc/shadow.,

.etc/passwd
,

./etc/shadow,,
,.
/etc/passwd,
,.
:

/etc/passwd;
;
;
;
;
;
.

,,
..3,
useradd.,
,,
,/etc/skel.:
,
/etc/skel/*.,
,/etc/skel/.
useradd,,
/etc/skel.
,
.,:

(..),/etc/passwd
(c);
,(g);
,(G);
UID,UID,(u);
(s)

.D,
.
.
,
passwd login_name.
(login_name
).

usermod,useradd,
,
.
.
""/etc/group
,groupaddgroupmod.
,(
).,
su.
,.,
,(
""),,,
(,)(.15).
,.
su,
.(.16).
,,exit,
.
sgsu,.
,.

.
,,
,.,
,,,
"".:

/etc/issue,"login:";

/etc/motd,.

,
.
,.,
/etc/rc.d/rc.local/etc/issue/etc/motd
(,,RedHat/etc/issue/etc/motd).
,,,/etc/rc.d/rc.local.

8.6.
:

,,,.
.,
,.
,swap
(..8.3,8.4).,
.
8.6.1. ?
,
:.
,
?
rpm,:
rpm -qpi _Size,
.,.

df.,,
,
.1.
,
-h:
[user]$ df -h

,
:
[user]$ df -h /dev/hda2

()
,
,().
,.
:,
,,.,
,,,
.
(),()
.,
(),du(discusage).
du,.

(/usr/lib)
[user]$ du -ks /usr/lib

91418 /usr/lib

,/usr/lib91418(k,
).s,
.,
,.,
.
sS,
(),.
maninfo.
8.6.2.
,,,
.,,
.,Linux
,.
,(,
).
,,.
Linux(BlackCat6.0)486
350.
,
90%.,
.
1. ,
.,,,

[root]# rpm -qa > packages

packages
.
rpme.
.
,rpm,
,
,.,

root.
,,packages
AfterStepAPPS9903292.
[root]# rpm -qi AfterStep-APPS

,AfterStep.
,,
AfterStep,
[root]# rpm -e AfterStep
[root]# rpm -e AfterStep-APPS

5800.,
,.,,,gnomecore,
gnomelibs,gnomeaudio,Gnome,
KDE.,gnomecore,rpm
,,xmmsgnome.
gnomelibs.

Gnome,,,
(.17).7800.
2. /usr/man,
man.100
.
3. /usr/lib/kbd/keymaps,,,
,
,/usr/lib/kbd/keymaps/i386,
qwerty.
,
(,).
/usr/lib/kbd/keymaps/i386/qwerty.
/usr/lib/kbd/consolefonts,
,,
.

(,,),
/usr/share/locale,.
16,15
.2/usr/share/i18n/locales
/usr/share/i18n/charmaps.
4. /usr/share/doc/HTML/,

,,.
en,ru,default,
en,2.
500.
,,,
,.,,
rpm
,.
,.

8.7.
,,,
.,
,
LINUX,
.,RedHatLinux
,.
,linuxconf
(http://www.solucorp.qc.ca/linuxconf).,
.

.8.6.linuxconf

.8.6,linuxconf
..
.
,
.,
.,
.,
Useraccounts(),.8.7.
Add,
,
(..8.8).

.8.7.

linuxconf.
,
.,
Linux,,[1.3].,
.
.
.,.
,
,
,,,<Enter>,
.

.8.8.

8.8.
,
loginshell.loginshellbash
:

/etc/profile
~/.bash_profile

~/.bash_login
~/.profile

().bash
(..
),~/.bashrc.
,Mandrake~/.bashrcloginshell,
/etc/bashrc.,,.
,
"",
.
,
.
/etc/profile/etc/bashrc,
.
,
,,
(,,,,
,).
,.
,.
.5.6,set(
typeset)env.,,
echo $name,name.
,set,PS1
PATH.,,
.5.6.,.
,
.PATH.
PATH:/etc/profile(,
)(,~/.bash_profile),
.
~/bashrc,
,...PATH
(
/home/user/bin):
PATH=$PATH:/home/user/bin

,.,
,

PATH.
MSDOSLinux.,
,,
(,,)PATH.,

,
,
.,,,,
,,
.
"",ls(
)./etc/bashrc,
:
alias ls = "ls -F --color"

,,MidnightCommander,
,COLORTERM:
COLORTERM = ; export COLORTERM

9.

,
.,
.,
Linux,,
:

,(
DOS/Windows,Linux,swap);
3,5;
CDROM;
;
;
;
;
;
ZipIomega,.

.,
.7,
,,7

.,,

9.1.
,
.,
,.
,
,
.
.
,,
.
(""),
.
,,,
,
,.
Linux.
().

.,
.
VGA,IDE,
,.
.
()
,
.,
().
,
.SCSI,
.
/lib/modules.
,
./etc/modules.
/etc/modules.conf.

"",(updatemodules).

lsmod.

insmod"".

:
insmod joystick

rmmod"".

:
rmmod joystick

modprobe.,

:modprobe


.o,
.:,"joystick.o",
"joystick".

,,
,.
,,
lpd(
,,
.9.6).X(
),7.
,
.
,
/dev.
Linux:
<><><>
,
.

9.2.
,,
.

,
,:
1. .Linux
.(),,
,.(),
,,,
.
,.

(FIFO).
2. ,,,
.
/usr/include/linux/major.h.
9.1.

IDE

()

SCSI

14

22

IDE

,
.,Ethernet,
eth:eth0,eth1..
3. ,..
.
/devls l ,,
,,,.
.
,.
,

[user]$ cat /proc/devices

,
,/dev()
.mknod (,
,mknod
).:
mknod [] _ _ _ _

_:

b;

c();

u;

p.

(b,c,u)
,.
,COM3,Linux
/dev/ttyS2:
[root]# mknod -m 660 /dev/ttyS2 c 4 66

(
4,64).
,,,
..,
,(chmod 666),
/dev/cdrom,/dev/floppy,/dev/modem.,
"cdrom",/dev/cdromcdrom,
.
.

9.3.
,,,
,.,:

;
,
.

()

kbdrate.
9.3.1. kbdrate

230.(r)
,.
-d(2501000
250).,
/etc/rc.d/rc.sysinit:
/sbin/kbdrate -s -r 16 -d 500

s.
,
:10,9,250
.
,,
NumLock,CapsLockScrollLock.
setleds.,,NumLock,
/etc/rc.d/rc.sysinit:
for tty in /dev/tty[1-9]*; do
setleds -D +num < $tty
done

.,
,
,.
.
9.3.2.
.
,
..
.


.
ASCII(
),

.7,..
,1287
.32()
(,,,,..).
IBM
.ASCII128,
,80.
(81)IBM
,,
(,,..).
IBM.
IBM,
,.,
,IBM
,.
865(Nordic),864(Arabic),
862(Israel).
(
).
IBM866.
.,
.
,
:IBM866,CP1251,KOI8R,ISO88595.
(0127)
.
(
IBM866,).MicrosoftMS
DOS.,
IBM.
IBM,
,.,
,,
MSDOS,
.
KOI8UNIX.UNIX
,KOI8
.7
ASCII.

,
.,,,
KOI8,, " " ,
!,KOI8R
,RFC1489
("RegistrationofaCyrillicCharacterSet")..,
,KOI8.
(ISO)
,,ISO8859X.
8,
(0127)ASCII,
.:

88590(Latin0);
88591,(Latin1);
88592;
88595;
88598.

Microsoft,
WindowsCP1251.
,256,ASCII
(128ASCII),
characterset(charset).
,,256
.,
(,).
UNICODE,,
,(
,,,..).
,
.UNICODE16(2),
65536.49000
(EURO1998.).
128ASCII.
.9.1
UNICODE.

.9.1.UNICODE.

UNICODE(
U,+)
.
UNICODE.
9.2. UNICODE

UNICOD
E

(CharacterName)

U+0041

LATINCAPITALLETTERA

U+0061

LATINSMALLLETTERA

U+042E

CYRILLICCAPITALLETTERYU

U+002B

PLUSSIGN

U+0031

DIGITONE

U+03A9

GREEKCAPITALLETTEROMEGA

U+2569

BOXDRAWINGSDOUBLEUPAND
HORIZONTAL

UNICODE
UNICODE.
,
UNICODE.7ASCII,
8()ASCII.,
,,128256,
.UTF7
UNICODE7ASCII,UTF8
UNICODE8ASCII.
UTF7UTF8[11.3

11.5]

.
,ASCII,UNICODE,
,
.(,,)
,,
.
(,,
,,UNICODE)
charset.,,
KOI8R,ISO_88591,ASCII.,.
9.3.3.

().
1. ().:>
.
2. :>
.
3. ,,
,ASCIIUNICODE;:>,
.
4. ,,
:ASCII>.

.,.
,
Linux.
:.
,,,
,.

,
.,
4:

K_RAW,,
.,
.
XWindow.
K_MEDIUMRAW,127
,(keycodes).
.
.
,,
getkeycodessetkeycodes,
.,
.
K_XLATE(ASCII),ASCII
ASCII
,.,Red
HatLinux5.2defkeymap.map
/usr/lib/kbd/keymaps/i386/qwerty.dumpkeys

,loadkeys
.

K_UNICODE,UNICODE
().

,
.,
ASCII
,,
.,
<Ctrl>+<Alt>+<Del>shutdown -r 0,..
.
kbd_mode.
,RAW
MEDIUMRAW,..
.
,
.,,
.<Shift>(),<Alt>(),<Ctrl>(
),<CapsLock>,<NumLock>,<Ins>.
(),
.
,.
<Ins>,
,
.
ASCII256,,,ASCII
256.,
.
,Escape
,Escape,
.Escape
,
,,<PageDown>,<PageUp>,<Home>,<End>,<F1>
<F12>,<Ins>,<Del>..
RedHatLinuxshowkey,,
.s,
(,10
,).showkey -k

().showkey -m
ASCII,,
.
<Ctrl>+<=><Ctrl>+<Esc>,,
ASCII().showkey
u,UNICODE.
:
,showkey,
.!,showkey
,telnet..

ASCII,,
,
.,,
.,.
9.3.4.
RedHat
/etc/rc.d/rc.sysinit.
.,
/lib/kbd/keymaps/i386/qwerty/usr/lib/kbd/keymaps/i386/qwerty,
/etc/sysconfig/keyboard.
,kbdconfig.
kbdconfig/etc/sysconfig/keyboard
.,
/etc/sysconfig/keyboard
[root]# /etc/rc.d/init.d/keytable start

"".
/etc/sysconfig/keyboard,
(
ruwin.map):
[root]# loadkeys /usr/lib/kbd/keymaps/i386/qwerty/ru-win.map

,"",
,,
.
,(,)
.
Linux(BlackCat)

ru1(<Shift>+<7>,<Shift>+<6>).,
Windows,Windows(
<Shift>).
ru_ms.,
,.,
ru_win_ctrl.map.gzIPLabs
(http://www.iplabs.ru/Linux/ru_win_ctrl.map.gz).
/usr/lib/kbd/keytables/i386/qwerty/,kbdconfigru_win_ctrl.

,
.,
.
,,.(,
,/etc/sysconfig/keyboard).
9.3.5.
,
/usr/lib/kbd/keytables/i386/qwerty/,,
.,,
(
,pharao@kma.mk.ua).

<Ctrl>,IBM,
,,Linux.
..showkey
keycodes(showkey,,
mc)(),
:
[root]# showkey --keycodes
kb mode was XLATE
press any key (program terminates after 10s of last keypress)...
keycode 125 press
keycode 125 release
keycode 126 press
keycode 126 release
keycode 127 press

keycode 127 release

125,126,127.
/usr/lib/kbd/keytables/i386/qwerty,,(
ru1.map,/usr/lib/kbd/keytables/i386/qwertyru1.map.gz,
:gunzip ru1.map.gz).
,
(),AltGr,
AltGr_Lock.ru1.map:
keycode 125 =
keycode 126 =
keycode 127 =

:
keycode 125 =
keycode 126 = AltGr
keycode 127 = AltGr_Lock

,.
,<Ctrl>(
97),
keycode 97 =

:
keycode 97 = Control

:,<Ctrl>,
"/",<Alt>
"/"(..,
).
(,mymap.kmap)
/etc/sysconfig/keyboard.
9.3.6.
.
(,,
)"XKeyboardExtension"[11.6].
.
,XWindow
.X(

).
"""",
(<Shift>,<Control>,<Alt>,<CapsLock>..).""
,,
.,
.
Xlib.Xlib,"",
,X
""X.
xmodmap.xmodmap
pk.
9.3.7.XKB
Linux
XKB.XKB
"".""("coreprotocol","core
")XKB,""
"".
XKB,Xlib
(,""XKB).,XWindow,
X""XKB,Xlib.
,XKB,X,
,Xlib.
,,
Xlib,""XKB,"
".,XKB""Xlib,
""("coreprotocol").,""
/.Xlib
X()
(,).
XKB,""Xlib
().
X,XKB,
""XKB.,
XKB.xkbcomp,
,XKB.
,xkbcomp,.
,XKB,/usr/X11R6//lib/X11/xkb
5,:

keycodes
,
.
<TLDE>= 49;
<AE01> = 10;

types
.
,(<Control>,
<Shift>..).,,""ALPHABETIC,
,<Shift>
<CapsLock>.<Enter>ONE_LEVEL,,
,.

compat(compability)
"".XKB
,,,,
.,
compat,
.
"".

symbols
,(
,keycodes)(symbols),
.,
(types),
,""
(compat).

geometry
"",..
.X,
,.

,(,
).,
(,)
_ "_" {........};

,,,
_(_),,us(pc104).,(

)default.,
,.
XKBImputDevice,,
XFree86,../etc/X11/XF86Config4.
.
,
,
Option
Option
Option
Option
Option

"XkbKeycodes"
"XkbTypes"
"XkbCompat"
"XkbSymbols"
"XkbGeometry"

"xfree86"
"default"
"default"
"us(pc104)"
"pc(pc104)"

,,:

keycodes"xfree86"keycodes,
,default;
types"default"types;
compat"default"compat;
symbols"us"symbols,
"pc104";
geometry"pc"geometry,"pc104";

,()include
"_(_)"(,_),
().
,
,X.
,
.keymaps,
XKB,(,
)keymap.
,keymapXKB
(,,
),
xkb_keymap "ru" {
xkb_keycodes

{ include "xfree86" };

xkb_types

{ include "default" };

xkb_compatibility { include "default" };

};

xkb_symbols

{ include "en_US(pc105)+ru" };

xkb_geometry

{ include "pc(pc102)" };

,include
()"+".,,
.
,X
keymap,
Option "XkbKeymap"

"xfree86(ru)"

,.,
keymap,,geometry,

Option "XkbKeymap"

"xfree86(ru)"

Option "XkbGeometry" "pc(pc104)"

,,keymap
"xfree86(ru)",""geometry,.
.
,""(Rules),""(Model),""
(Layout),""(Variant)""(Option).
Rules(
rules/usr/X11R6//lib/X11/xkb),
"XKBModel,
Layout.."."":

Model"";
Layout,,,"";
Variant(Layout');
Options""""Control
Group("",,
/).

XKB""
(keycodes,types,compat,symbolsgeometry).,Rules
,Model,Layout,VariantOptions,,
,XKB
keycodes,types,compat,symbolsgeometry(keymap).
,XKB,
X,XkbRules,XkbModel,XkbLayout,
XkbVariantXkbOptions.
,
Option
Option

"XkbRules"
"XkbModel"

"xfree86"
"pc104"

Option
Option
Option

"XkbLayout"
"XkbVariant"
"XkbOptions"

"ru"
""
"ctrl:ctrl_ac"

,XKB,
./rules/xfree86,"pc104"(104),
(""),""(..,
),,"
""ctrl:ctrl_ac".
,""""""(
),xfree86.lst(*.lst,
"",xfree86),,
"",..rules.
"/".XKB
""""/,
""CapsLock.:
""
"".,,,
/().,
,CapsLock,
.,,""
.
(3.3.4)Xfree86""
"".,
""XKB.
9.3.8. XKB
XWindow.
XFree863XF86Setup.
XKB.""""(XkbRules)xfree86.
""(XkbModel),""(XkbLayout)"
"("/").
,"Ctrl".,
XkbOptions.,
XF86Setup,Keyboard.Model(
)Layout().()
"","Ctrl".
Xfree86
Keyboard.

,
InputDevice(Keyboard)/etc/X11/XF86Config.
,,"":

xfree86""XWindow;

pc101(pc104,pc105..)();

ru"".

keymap.
"keymap'"xfree86,"".
xfree86,""
()xfree86(us),xfree86(fr),xfree86(ru)..keymap
/usr/X11R6//lib/X11/xkb/keymap.dir.
""
Option "XkbKeymap" "xfree86(ru)"

,CapsLock/(.
),"keymap"
"".
./keymap/xfree86"ru".
xkb_symbols.CapsLock
group(caps_toggle).,xkb_symbols
xkb_symbols { include "en_US(pc105)+ru+group(caps_toggle)"};

(.."/")
/usr/X11R6//lib/X11/xkb/symbols/group(
xkb_symbols).
,
"","",""..:

""(rules)""(xfree86);

""(model)(pc101,pc102..);

""(layout)""(ru).

,:
Option "XkbRules" "xfree86"
Option "XkbModel" "pc104"
Option "XkbLayout" "ru"

XkbOptions"".
XkbOptions/rules/xfree86.lst,

"!

option".

,,,.
CapsLock
Option "XkbOptions" "grp:caps_toggle"

,,
(keycodes,compat,types,symbols,geometry).
,keymap.
""rules/model/layout.:

keycodesxfree86;

typescompatdefault("")complete("");

geometry,,"pc",pc
pc(pc101),pc(pc102),pc(pc104).""
/usr/X11R6/lib/X11/xkb/geometry.dir.

symbols.symbols/ru""
.,(
Enter,Shift/Ctrl/Alt,F1F12..).symbols
en_US(pc101)(),,ru.
symbols/usr/X11R6/lib/X11/xkb/symbols.dir.
"/"(,
symbols/group).

Options
Options
Options
Options
Options

"XkbKeycodes"
"XkbTypes"
"XkbCompat"
"XkbSymbols"
"XkbGeometry"

"xfree86"
"complete"
"complete"
"en_US(pc101)+ru+group(alt_shift_toggle)"
"pc(pc101)"

""(,
XkbOptions),""rules/xfree86.lst
""XkbSymbols.,
XkbSymbols "en_US(pc101)+ru+group(shift_toggle)+ctrl(ctrl_ac)"

,
XKB.,
.[11.6].

9.4.
(serial
mice)(busmice).

.busBusmouse
HOWTO(ChrisBagwell),1.91151998.
9.4.1.
:
.
,,
,.
Linux4bus:Inport(Microsoft),Logitech,PS/2ATI
XL..
Inport.
,,,9
(),,Inport.
Logitech,.
,.
PS/2,(PS/2Auxiliary
Deviceport).6(6pinminiDIN
connector),.
ATIXLInport.
,.,
ATIXL(ATIXL),,,
.
.Inport,Logitech
ATIXL''BusMouse'',PS/2''PS/2''.
9.4.2.
,,,
.,
Linux,
.
,,
!
(),

[user]$ cat /proc/interrupts

/proc/interrupts.

IRQ4(/dev/ttyS0),
IRQ3(/dev/ttyS1,,
,IRQ).IRQ5SCSI
,IRQ12.
IRQ12,PS/2,,
IRQ12PS/2.ATIXL,InportLogitech
IRQ5,,
.,
,,
InportLogitech.PS/2
IRQ12,,
.
9.4.3.
.
,/etc/sysconfig/mouse,:
MOUSETYPE="Microsoft"
XMOUSETYPE="Microsoft"
XEMU3=yes

,,,,"PS/2".
,gpm.
,gpm,:
[user]$ ps -A | grep gpm

,.gpm
,/etc/rc.d/init.d/gpm,
gpm.:
daemon gpm -t $MOUSETYPE -d 2 -a 5 -B 132 # two-button mouse

(.man

gpm).

gpm,.
.,
.,
..XWindow,
,,.

9.5.
9.5.1.
Linux
(.9.3).
9.3.

1 2
IDE1 22

/dev/hda/dev/hdb

063 64127

IDE2 33

/dev/hdc/dev/hdd

063 64127

SCSI

/dev/sd

015 1631

IDE0,
64(/dev/hda/dev/hdb).
,.
,,:
1/dev/hda1,2/dev/hda2.
IDE,
,4IDE(/dev/hd[ad]).
,SCSI0,16,32,
/dev/sd[ag].,
:/dev/sda1(
/dev/sda1),/dev/sdb17(/dev/sdb1),
.
9.5.2.
Linux.,
,
.

.Linuxfdisk,cfdisksfdisk.
manfdisk,cfdisk
,.fdisk,
,.
,DOS,BSD.

sfdisk,fdisk,fdisk,cfdisk,

.man
:cfdisk,fdisk,sfdisk.
,,
.
PartitionMagicPowerQwest.2,
,.
,
Linux,.mkfs.
ext2fs,.
:
[root]# mkfs t /dev/hda3

,,ext2,/dev/hda3
(.19).
mkfs,,
.
!
mkfs!,inodes.
,.

.
mount,,.
,,,,
,,,..
,lost+found.
,:
fsck""
.fsck,
,hdparm.
9.5.3. hdparm
hdparm,IDE
().
.,.
,,
.
,,.
[11.8],10

,[1.5],
,
.,,,
,,.,
RobFlickenger[11.8],IDEEIDE,2
,!
,
,.
,hdparm
,sync,
,.
:
[user]$ hdparm

,
.
,,
(IDE).:
[user]$ hdparm /dev/hda
/dev/hda:
multcount = 0 (off)
I/O support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 0 (off)
keepsettings = 0 (off)
nowerr = 0 (off)
readonly = 0 (off)
readahead = 8 (on)
geometry = 1870/255/63, sectors = 30043440, start = 0

,.,
.,
,.
!
,
hdparm.

-i,

-g(//),
(),(,
,0).
T(..
).
(
).

,,
[root]# hdparm -Tt /dev/hda

(,,):
/dev/hda:
Timing buffer-cache reads: 128 MB in 1.34 seconds = 95.52 MB/sec
Timing buffered disk reads: 64 MB in 17.86 seconds = 3.58 MB/sec

.,
,hdparm:

c
.16,
c13,32
.,3,,
.
d 1DMA(DirectMemoryAccess
).,,
DMA.
m.
,.
.
MaxMultSect,
hdparm i .
pPIO().
(05),
.
,,
.
u,

,.,

(,).
,
!

.,

hdparm tT /dev/hda

(,
!),()
,.
,.
,:
[root]# hdparm -X66 -d1 -u1 -m16 -c3 /dev/hda
/dev/hda:
setting 32-bit I/O support flag to 3
setting multcount to 16
setting unmaskirq to 1 (on)
setting using_dma to 1 (on)
setting xfermode to 66 (UltraDMA mode2)
multcount = 16 (on)
I/O support = 3 (32-bit w/sync)
unmaskirq = 1 (on)
using_dma = 1 (on)
[root]# hdparm -tT /dev/hda
/dev/hda:
Timing buffer-cache reads: 128 MB in 1.43 seconds =89.51 MB/sec
Timing buffered disk reads: 64 MB in 3.18 seconds =20.13 MB/sec

,6!
,hdparm
,
.

,,/etc/rc.d/rc.sysinit(ALTLinuxJunior1.0

IDE/etc/rc.d/scripts/idetune).
,
(..9.5.4).
,,
(,),hdparm
,
.hdparm
man(man 8 hdparm).
9.5.4. fsck
fsck,,,
,,
,
.
fsck
,.
:

,;
,,
;
,,;
(inodes),;
..

:
[root]# fsck [] [ t fstype] [--fs-options] filesystem

fstype,filesystem
(,/dev/hda4),(/,/opt,/mnt/wint)(:
manfsck,(label),
UUID,,,).
,fsck,

.fsck.fstype(,fsck.ext2)fsck
/sbin,/etc/fs
/etc,,,,PATH.,
,fsck.fstype.
fsck()
A,a,rN.a,

.A,
/etc/fstab
.r,..
,,.
N,
,,.
Linuxfsck.
fsck:
(,
)
.
(.16)
.,
""(clean)
.,
""(dirty).,
"",,""fsck.,
"",
/,A.,
,/etc/fstab.
,,,
/etc/fstab.
..
,.
,,,,
.
(,),
,.
fsck.
(
"").,fsck/usr
,
,,,fsck
.
,fsck.
,
,,
.
,

fsck.
,
(kernelpanic).
fsck"",..,
,lost+found
.,
"",,
.

9.6.
9.6.1. UNIX
UNIX:LPD(LinePrinter
Daemon)[RFC1179],BerkeleyUNIX(BSD),AT&TLinePrinter
system.70
().,
(,),,
.,
.[LPRng,Palladin,PLP],

.,,
.
UNIX,Linux,,
(,),
.,,
,.
,
.,,
.,
,,
().
LinuxBSDLPD,,
LPRng.LPRng,
.

lpd.rc,

lpr.lpr

,lpd.

lpr,
.,,
lpr.

lpq,,

lpclpd.lpc,

..
,.

lprm.

.
lprlpd
,.
,LPD.
lpr,,
.Pprinter,
PRINTER,
,(lp).lpr,
,
,/etc/printcap.lpr
(),.
/var/spool/lpd/printer.(
),printer.
lpr:cfxxxdfxxx,
xxx.cfxxx
.,
,,
.dfxxx,.
lprlpd.
lprlpd/dev/printer. lpd
/etc/printcap,,
,./etc/printcap,
,lpd,
.,lpd
.,.
,lpd
lpd.

""
(FIFO).
lpc.
2.1.33lpparport.
parport,lp
,,
I/O..
[11.11].
9.6.2. /etc/printcap
/etc/printcapLPD.
,().
lpd,..
/var/spool/lpd
/etc/printcap.
/etc/printcap:
# djet500
lp|dj|deskjet:\
:sd=/var/spool/lpd/dj:\
:mx#0:\
:lp=/dev/lp0:\
:sh:

/etc/printcap,(
),.
,(
).xx=xx#,xx
, .
,,"".
:.,#,
.,
.
lp,dj,deskjet,
/var/spool/lpd/dj,,
/dev/lp0,(,
,)
.
,,

printcap.(),
.

sd=_..

(/var/spool/lpd)
,.
,
:,
.

lp=_.

.,
,
.
,rw,
,.

rmrp.
,(
)./etc/printcap
rmrp.rm,
,rp
.
mx.mx()

.
,
,(
).
,,
,,,
.
.,
,,,
#,,mx#0.
mx=0,,
mx.
of,ifnf.
,"".
,
/etc/printcap/.

9.6.3.lpd printconfgui
LPD,
.
,,.
,
.RedHat6printtoool,
7.1printtoolprintconf-gui,
KDE./etc/printcap,
./etc/printcap
,printconf-gui,
.9.2.

.9.2.printconfgui

,,
(.9.3),(
,),(aliases).

.9.3.

.9.4.

,
.
.:

,
USB;
UnixPrinter(lpdSpool),UNIX,
TCP/IP(,,
Linux);
WindowsPrinter(SMBShare),,
WindowsSamba(SMB);
NovellPrinter(NCPQueue),,
Novell'sNetWareNCP;

JetDirectPrinter,,
.

,
( ).
PrinterDriver
,,
(.9.5):

.9.5.

,
..9.6,
HewlettPackard.

.9.6.HewlettPackard

PrinterNotes
(.9.7).

.9.7.

,(.9.8)
:(,,),
,,..
,OK.
/etc/printcap.

,.
,
,lpd.
.

.9.8.

,
.3:PrintPostScript
TestPage,PrintA4PostScriptTestPage,PrintASCIITestPage.,
.
,,,,
,,.,
"",
.
().LPD
.
9.6.4.
,lpd
,.
lpd,
,.
,,
,.
,,shell,
.lpr.
,,if,ofnf
/etc/printcap.if,
of,(),
.of,if,lpd
,
.,
.ofif,
if.
/etc/printcap:
:if=/var/spool/lpd/dj/filter:\

,.
,:
This is line one.
This is line two.
This is line three.

PostScriptPostScript,

"",."PrintingHOWTO"
,,
"":
#!perl
# perl
# : chmod 755 filter
while(<STDIN>){chop $_; print "$_\r\n";};
# : print "\f";

/var/spool/lpd/dj/filter,
.
ASCII.
,,PostScript.
,
.,
ghostscript.
9.6.5.PostScriptGhostscript
,
.
.
""80
PostScript,
AdobeSystems,Inc.UNIX,
.

.AdobeSystems,Inc.,
PostScript,.,
PDF(Adobe)
PostScript.
,PostScript,:,,
,
.,""PostScript,..PostScript
(PostScript),.,
.
PostScript,PostScript
.PostScript
,.

,PostScriptGhostscript
(http://www.cs.wisc.edu/~ghost/),gs..
Ghostscript,AladdinGhostscriptAFPLGhostscript,
,
Linux.GNUGhostscript,gs,
.
AFPLGhostscript7.0,GNUGhostscript5.5.Ghostscript
,
.,,
Ghostscript.gs
/etc/printcaplpd.gs
.
9.6.6. Ghostscript
GhostscriptPostScript,
PostScript.
ghostscriptfonts.
,.
,Ghostscript,.
FHS(FilesystemHierarhyStandard),
,,Linux
.
.,Ghostscript.
,:

,,PostScript,
,Ghostscript.,,
,,,
Ghostscript,.
.,,,
,Linuxghostview(gv),
ghostscript.,
("printpreview"),
PostScript.gv ,
cgs.,
(),
""ghostscript.
,Ghostscript
LPD,(gs).

.
gshelp.,,
(,
,),,,
.,,,
.,
.
,Ghostscript.,
,,
PostScript.
Fontmap(Fontmap.GS),
/usr/share/ghostscript/N.NN,N.NN
ghostscript(5.50).()
.

,Ghostscript,
(/),
;
(aliace).
,
(gsf,pfapfb),
MSDOS,..(
),.,
Ghostscript,
(/).
,,,
.

Fontmap.
""ghostscript(
),gs"",
.fonts.dir,
(fonts.dir.11.4).
,Fontmap
(
),
.,
/Courier/NimbusMonLRegu(,
(n022024l.pfb)).,
PostScript,

.PostScript
.,
Fontmap.

[user]$ gv filename.ps

filename.ps,
.
,.
[11.12],
Ghostscript,.,
[11.13][11.14],
.
9.6.7.
,,
,,
.
,(
rmrp/etc/printcap,).
printconf-gui,(..9.4)
"UNIXprinter(lpdQueue)",Linux.
WindowsSamba,,,
"Windows(Samba)"
.Linux
/etc/lpd.perms( . man).

9.7.
RedHatLinux,sndconfig.
.
(.9.9).


.9.9.sndconfig

isapnptools.,
(.9.10).

.9.10.

,/
(I/Obaseaddress),IRQ,DMA,16bitDMA(.9.12)..
2,
,.,
/etc/modules.conf,,xmms(
,.15).

.9.11.

x11amp()
(,
),mp3,
Windowswinamp.,x11amp
xmms.
,"LinuxHOWTO"[11.15].

9.8. CDROM
LinuxCD:,
CDROM,,CD.
Linux,CD,
,,.CDROM
Linux,Linux./dev
().,,
:
[root]# cd /dev
[root]# ln -s hdc cdrom

hdc,,CD.,
,,Linux.
,/var/log/dmesg
dmesg.

.9.12.CDPlayer

CD,
xplaycd.KDECD
"CDPlayer"(.9.12).KDE.

9.9.Zip Iomega
,Zip,,
ppa,,
.insmod ppa
/etc/rc.d/rc.sysinit,insmod
ppa.,ZIP
Iomega,
mount -t vfat /dev/sda4 /mnt/zip.

,insmod ppa(,
ppa).insmod ppa
,Zip.
5.2BlackCat6.02.
,Zip.lomega1.0.1
(lomega,iomega),
(JohnHawk,email:visionary@gtemail.net).Linux
Zip/JazIomega.targz
(),(
,)ZIP.
,,(
root):
[root]# chown root:root /directory/lomega.
[root]# chmod +s /directory/lomega.

mount/umount,
/usr/local/bin/lomega.
Zip.
Zip,,
.,
,,.
(,,
),Zip,
backup.
BackUp.,
tar.
,lomegatar.
,,
,,
.,

""(trash),,,.
,"Empty
Trash",.
lomega/etc/lomega.conf.
/etc/fstab.
:

-e;

-v;

/dev/sda(

lomega.conf).
,ZipLinux:
mtools.,,,
/etc/mtools.conf:
drive z: file="/dev/sda4" exclusive

Zip
ppa.
.RedHat7.1ALTLinuxJunior1.0(
)Zip.

10.