\chapter{ʹıļ}

\index{text files}\index{files!text files}\index{binary files}\index{files!binary}%
    ıļ~GNU/Linux~ϵͳӦõʮֹ㷺
ǰĵļϢҺãʹǲ̫ѡ

\section{鿴ıļ\index{Files!Text}\index{Text Files}}

    һ\emph{ıļ}ʵһ˿ɶıı׼ļ
֮⣬ûĵطһ͵ļļ
Ҫн͡

\index{viewing!text files}\index{text files!viewing}%
\index{files!text!viewing}\index{binary files!viewing}%
\index{files!binary!viewing}\index{displaying!text files}%
\index{file pagers!text files!viewing}%
    㰲װ~less~ļĻʹ鿴һ͵
ļûаװװϣǳã
~\texttt{\standardtilde less~/etc/profile}~鿴һʾıļ
ע⣬ʹļĺǻɬģȻԶеַ
~\texttt{\standardtilde less~/bin/ls}~鿴һļ
ģ\texttt{ls}~˶Բɶ

    ʱ\label{zless}ᷢ~\texttt{.gz}~βļЩļ
ܹʹ~\texttt{zless}~鿴һ

\begin{lyxcode}\standardtilde
zless~/usr/doc/ae/changelog.Debian.gz
\end{lyxcode}

\tip
\texttt{zless}~ڲ鿴ĵ˵ʮãͨ~\texttt{.gz}~ʽġ
\endtip

\index{comparing!binary and text files}%
\index{Ƚ!ƺıļ}%
    ļ֮ĲȫֻݵĲ
ͬһЩĲϵͳ~DOS~~MacOS
ǶԲͬļĴʽͬ

    ıļ԰~shell~űĵȨ֪ͨκ˿ɶı

\index{source code!comparing to binary executables}%
\index{binary executables!comparing to source code}%
    ˳ἰһԴƿִļ֮Ĳ%
\texttt{/bin/ls}~һƿִļԴ~Debian~
Ҳһıļ֪~/bin/ls
ıļԴ롣~\texttt{/bin/ls}~~\texttt{/etc/profile}~Ƚϣ
ͻ޸һԴжôҪ
ṩѯҪԴ롣


\section{ı༭\index{Editors}\index{Files!Editors}\label{editor}}

\index{text editors}\index{editing!text}\index{programs!text editors}%
\index{utilities!text editors}\index{applications!text editores}%
\index{files!text!editing}%
    \emph{ı༭}޸ıļݵĳ
ϵͳһı༭DOS~~\texttt{edit}
Windows~~\texttt{Notepad}~~MacOS~~\texttt{SimpleText}

    Debian~ṩ˴ı༭\texttt{vi}~~\texttt{Emacs}~
͵ģǶǹǿʹ㷺ı༭
\texttt{vi}~~\texttt{Emacs}~ǳӣҪһЩ
ǿʮָЧر༭ı
\texttt{Emacs}~ͬʱն˺~X Window~ϵͳУ
\texttt{vi}~һֻն£~\texttt{vim}~ıִ~\texttt{-g}~ѡ
~X~¡

\index{nedit (text editor}\index{ae (text editor)}\index{xcoral (text editor)}%
\index{Emacs (text editor)}\index{vi (text editor)}
    򵥵ı༭~\texttt{nedit}\texttt{ae}%
\texttt{jed}~~\texttt{xcoral}%
\texttt{nedit}~~\texttt{xcoral}~ṩõ~X Window~ϵͳͼνӿڡ
һЩ~\texttt{vi}~ı֡
⣬Ҳҵһ~\texttt{GNU Emacs}~ı~\texttt{XEmacs}

    鲻κı༭ϸʹ÷
ǽҪؽһ~\texttt{ae}ΪСٶֿ죬
~Debian~ȴҵΪӦ
ֵһѧġҪִиΪصı༭ʱ
~\texttt{vim}~~\texttt{GNU Emacs}%
\texttt{Emacs}~ṩһֳɫĽʽָϣҪĶ
ʹ~\texttt{emacs}~~\texttt{Emacs}Ȼ\texttt{F1\nbs t}%
\texttt{Emacs}ڹעڶ;̱߱༭û˵
һּõѡ


\section{ʹ~ae\index{ae}}

\index{files!text!editing}\index{text editors!ae}\index{ae (text editor)}%
\index{programs!text editors!ae}\index{applications!text editors!ae}%
\index{utilities!text editors!ae}\index{starting!ae (text editor)}%
    ͨû༭ļ~\texttt{ae}£

\begin{lyxcode}\standardtilde
\$~\textbf{ae~filename.txt}
\end{lyxcode}

\index{displays!ae (text editor)}\index{screens!ae (text editor)}%
    ⽫һ༭ĻĻĶṩһЩݰ
׶ʾڱ༭ļ༭ƶʮּ򵥵ģ
ֻʹüͷɡ%
\index{saving!edited files (ae)}\inde{exiting!ae (text editor)}%
\index{quitting!ae (text editor)}%
ͨ~\texttt{C-x\nbs C-s}~ļȻͨ
~\texttt{C-x\nbs C-c}~˳༭һϰ˸ñ༭
԰~\texttt{C-x\nbs C-h}~Թرհ㹻ˣ֪Щ
лı༭ˡΪ˽б̻߸ϸµı༭
ῼоһǰᵽ༭


\chapter{X Window~ϵͳ}

\index{X Window}\index{GUIs!X Window}%
\index{graphical user interfaces!see GUIs}%
    ½ڽ~X Window~ϵͳͼûӿڡٶѾɹذհװֲ
ú~Xװֲδд㽫Ҫ~%
XFree86 HOWTO/usr/doc/X11~ݣԼ½ڵݣһ㰲װ~X
Ϳͨ~\texttt{startx}~ͨ~\texttt{xdm}~~X~
ʱѡ

\section{X~}

\index{modularity}\index{operating systems!modularity}%
    GUIͼλûӿڣ~Windows~~Mac~ϵͳҪ֡
ΪЩϵͳдһʹ~GUI~Ӧó򣬶ϵͳ
лʹõĸЧԡGNU/Linux~Ϊ\emph{ģ黯}Ҳ˵
СģĲɣЩԸݸҪѡʹ
ǲʹáһ־~X Window~ϵͳ߼~X

    òʱҲΪ~X11ע~``X Windows''~Ľз\emph{}ȷ

    X~ʵֳʾͨѶ֪͵һַ
Ҳ˵һͼӲ\emph{}%
\index{abstractions}\index{GUIs!abstractions}\index{hardware!abstractions}%
\index{devices!abstractions}%
ûӦóʹ~X~~X~ͨѶX~ȻΪضӲԡ
ζЩֻдһΣκ˵ļϹ

\index{servers!X servers}\index{X servers}\index{networks!X servers}\index{clien
ts!X clients}\index{X clients}%
    ~X~л˵ӲлỰĳΪ~\emph{X~}Ҫ~X~
ĻʾڻͼεûӦóΪ~\emph{X~ͻ}X~%
\emph{Կ}һƥԿ~X~

    X~ṩҪ~GUI~õκιܣŴڡ
һ~X~ͻ򣬳Ϊ~\emph{window managerڹ}%
\index{window managers}\index{displays!X windows system!windows manager}%
\index{screens!X windows system!windows manager}%
ģΪڻƱ߽ͱŴڣṩӲ˵~%
X~ͻĹܡض~window manager~ܻиӵĹܡ

    Debian~ϵͳе~Window manager~~%
\texttt{fvwm}\texttt{fvwm2}\texttt{icewm}\texttt{afterstep}%
\texttt{olvwm}\texttt{wmaker}\texttt{twm}~~\texttt{enlightenment}
Ҫһ£ѡġ

\index{icon-based file managers}\index{file managers!icon-based}%
\index{GUIs!icon-based file managers}\index{X Window}\index{GUIs!X Window}%
\index{graphical user interfaces!see GUIs}\index{applications!file managers}%
\index{programs!file managers}%
    ~X~򣬻~window managerṩ~\emph{file manager%
ļ}Ҳ˵κδڶļĿ¼ͼꡣ
װ~file manager~ΪһӦóϵͳаĳ%
GNOME~ƻ\index{GNOME desktop project}ڿһͼ
ļ~GUI~ߡο~\lnk{GNOME~ҳ}{http://www.gnome.org/}%
Իùڴ˵Ϣ

\index{network transparency}\index{X windows system!network transparency}%
\index{X clients!network transparency}%
\index{clients!X clients!network transparency}%
\index{servers!X servers!network transparency}%
    X~һ\emph{͸}ζ~X~ͻҪ
ͨѶǱ~X~򣬻ĳ~X~ʵ£
ζһΪǿԶ̻г򣬶ʾϡ


\section{~X~}

\index{GUIs!X windows system!starting}\index{starting!X windows system}%
\index{X windows system!starting}\index{manual startup!X windows system}%
    ~X~ķ֡һǵҪʹõʱֹ~X
Ϊʵִˣ¼һı̨~\texttt{startx}⽫~X~%
ת㵽̨ϡ

\index{xdm (X Display Manager)}\index{X windows system!xdm}%
\index{GUIs!X windows system!xdm}
    ڶַҲƼķǲ~\texttt{xdm}~~X Display Manager~%
ʹ~Xһԣ\texttt{xdm}~~X~̨~VC\nbs 7
һͼλĵ¼ʾ棬¼

    Ĭϵأַһ~\texttt{xterm}%
\index{xterms}\index{shells!xterms}\index{fonts!xterm!increasing size}%
\index{xterm!font size, increasing}%
һshellʾСڡ~shell~ʾ£
ı~VC~κ԰ձиʹ~%
\texttt{xterm}Ψһ~\texttt{xterm}~ı̨֮Ĳͬ
㲻һҪ¼~\texttt{xterm}ΪѾ¼~X~ˡ

    вֻ~X~ɣЩڱ½ۡ

    עĬϵ~\textt{xterm}~ʹõϸС
еһСļ߷ǳߵķֱʻ߲õ
ôҪıˡ²ȥ

\begin{enumerate}
\item ƶָ뵽~\texttt{xterm}~ڵ롣
\item ͬʱ~\texttt{Control}~\emph{}⽫ṩһĲ˵
\item ָҪ壬Ȼͷ갴
\end{enumerate}%
\index{selecting!fonts, xterm}\index{xterm!fonts!selecting}%
\index{fonts!selecting}\index{text!fonts!xterm, selecting}


\section{~X~}

    ӦϤһЩ~X~µĳòòֽһЩܷõĻ

\subection{}


\index{X windows system!mouse operation}%
\index{GUIs!X windows system!mouse operation}%
\index{mouse operation!X windows system}\index{buttons!mouse operation}%
    X~µʹϵͳǷǳƵģҪõ
ֻʹͬʱģмЧ
Ҫ㼼ɣҲе鷳Ͷһ~15~Ԫܲһ⡣
ЩǶе

    ٶʹ꣬մҵ˳бš˰һָ
ߵİָмİָұߵİܻ
ĵпŻλñʶ

    X~м򵥵õĸ-ճ\index{copy-and-paste!mouse operation (X)}%
ܡҪѡıиƣҷٶʹõӦó
и-ճĹ֧֣ôӦÿѡƵıҪճı
һͬXӦóµһм磬յһ
һ~URL~~e-mailѡи~URLȻweb
λáмճ

\subsection{X~ͻ}

\index{GUIs!X windows system!clients}\index{X windows system!clients}%
\index{clients!X windows system}\index{programs!X clients}%
\index{servers!X servers!clients}%
    ~X~ͨѶĳΪ~X~ͻ򡣴
Ҫ~X~Ļʾڡ

    ~X~ͻķʽκ~Debian~ķʽһ
ֻͻּɡһе~\texttt{xterm}~%
~\texttt{xterm}һµ~\texttt{xterm}~ͻͻ
Ļϡ

    ע⵽ԭ~\texttt{xterm}~Ѿ޷ʹˣΪ~%
shell~ڵȴڶ~\texttt{xterm}~ɡΪ˱⣬ͨ
~\texttt{\&}~̨Xͻ򣬾~
\texttt{xterm\nbs \&}ˣ԰һеĽ
ŵ̨ȥʹ~\texttt{CTRL-z}~̣Ȼʹ~\texttt{bg}~%
ŵ̨ȥ

    㾭ʹһĴڹͨṩһַѸó
ŵһݵͼλ˵С

\subsection{}
\index{X windows system!troubleshooting}%
\index{troubleshooting!X windows system}%
\index{GUIs!X windows system!troubleshooting}%
\index{error messages!X windows system!troubleshooting}%
    ʱһͼλĲ˵һ~X~ͻʱʧˣ
ô㲻ܿκδϢļ~\texttt{\~{}/.xsession-errors}~
ҵǡ

\subsection{뿪~X~}

\index{GUIs!X windows system!exiting}\index{X windows system!exiting}%
\index{exiting!X windows system}\index{killing!X server}%
\index{servers!X server!killing}%
    Ҫ뿪~XҪõһ˵ҵǣ˵ÿڹ
вͬڴڹʹַʽá
һԵĲ˵ôԲ鿴һ~``Exit''~~``Close Window
Manager''~Ŀ㲻ҵһ˵Ļϵһÿ
Щʧˣͨ~\texttt{CTRL-ALT-Backspace}~
ǿɱ~X~ǿɱƻڴ򿪵Ӧóδݡ

\subsection{Xʽ}

\index{customizing!X windows system}\index{GUIs!X windows system!customizing}%
\index{X windows system!customizing}\index{files!/etc/X11/Xsession!modifying}%
\index{/etc/X11/Xsession!modifying}%
    ~X~ʱDebian~һЩ~shell~űĴڹ
~X~ͻĬϵأΪһڹһ~\texttt{xconsole}~%
һ~\texttt{xterm}

    Ҫ~X~ʽôļ~\texttt{/etc/X11/config}~~%
\texttt{allow-user-xsession}ûд¼Ϊ~root~ӴС
Ȼ¼ΪԼ¿

    Կļ~\texttt{/etc/X11/Xsession}~~Debian~~X~
ôġעͨ޸ļ~\texttt{/etc/X11/config}~޸~%
\texttt{/etc/X11/Xsession}~ΪṩһЩϵͳĲѡ

    Ҫ~X~ʱѡĿͻ~home~Ŀ¼´һ
ִе~shell~ű~\texttt{.xsession}%
\index{clients!X windows system!selecting}\index{selecting!X clients}%
\index{X clients!selecting}\index{X windows system!clients!selecting}%
\index{GUIs!X windows system!clients, selecting}

\begin{lyxcode}\standardtilde
\$~\textbf{touch~\~{}/.xsession}
\end{lyxcode}
    ʹļ

\begin{lyxcode}
\$~\textbf{chmod~u+x~\~{}/.xsession}
\end{lyxcode}
    ʹļΪִеġ

    һ~\texttt{.xsession}Ҫʹİı༭
༭һЩõĹڸýűκ¡
ǣűĽжˣô~X~Ҳжϡ

    ʵӦУͨҪʹһ~\texttt{exec}~ĵսű
~\texttt{exec}~ʲôǽűḶ̌~%
\texttt{exec}~кԡִеĳ򽫳Ϊýű̵
µߣζ~X~³Ľжʱжϡ

    ٶʹ~\texttt{exec\nbs fvwm}~ս~\texttt{.xsession}
ʾXʱ~\texttt{fvwm}~ڹ˳~\texttt{fvwm}~%
ڹʱ~X~ỰҲͻ򶼽رա
㲻ҪһʹһڹҲ~\texttt{exec xterm}
£ض~\texttt{xterm}~~\texttt{exit}~ͻᵼ
~X~Ự̵Ľ

    Ҫʹ~\texttt{exec}~֮ǰͻôҪں̨
ǡ~\texttt{.xsession}~ֱÿͻ˳żһе
ִСοǰĹں̨ҵ½ڣһһ~\texttt{\&}~ʶ
ĩβ~\texttt{xterm~\&}

    ԳΪ~X~Ự̵Ľβ
ôʹ~\texttt{.xsession}~һڹƵĳ
ȴɡҲ˵Ҫʹ~\texttt{exec}~~\texttt{\&}ֻ~%
\texttt{fvwm}Ȼѡ~\texttt{fvwm}~֮

    һЩʾ~\texttt{.xsession}~ļܻЩ
еУʹѡĴڹ滻е~\texttt{fvwm}

    򵥵~\texttt{.xsession}~ֻһڹ

\begin{lyxcode}\standardtilde
exec~fvwm
\end{lyxcode}
    ⽫~\texttt{fvwm}~\texttt{fvwm}~˳ʱX~ỰҲ
ˡ㲻ʹ~\texttt{exec}еִпȥһ~%
\texttt{.xsession}~ʱȴ~\texttt{fvwm}~\texttt{fvwm}~%
ɺ˳ʹ~\texttt{exec}~ҪһЩΪ~\texttt{fvwm}~滻~%
\texttt{.xsession}~Ҫеȴʹ~\texttt{ps}~~%
\texttt{top}~֤ˡ

    һΪʵõ~\texttt{.xsession}~ڹ֮ǰһЩͻ
磬Ҫÿ~X~ʱһЩ~\texttt{xterm}~һ~\texttt{xclock}
û⣻ֻ~\texttt{\standardtilde xterm & xterm & xclock & exec fvwm}~%
ɡ~\texttt{xterm}~һ~\texttt{xclock}~ں̨ȻǴڹ
˳ڹʱҲ˳~X

    볢һ²ں̨УԿʲô
\texttt{\standardtilde xterm;~xclock;~exec~fvwm}%
\texttt{xterm}~ҵȴ˳Ȼ~\texttt{xclock}~
~\texttt{fvwm}~֮ǰò˳~\texttt{xclock}˳ִеģ
Ϊűڵȴÿ˳

    ԰Ҫʹ˳ִзʽÿʲôʱֹͣ

\begin{lyxcode}\standardtilde
xterm~\&

xclock~\&

fvwm~

date~>\textcompwordmark{}>~\~{}/logout-time
\end{lyxcode}
    ⽫ں̨һ~\texttt{xterm}~һ~\texttt{xclock}Ȼ
~\texttt{fvwm}~ȴɡ˳~\texttt{fvwm}~ʱִ
һУаѵǰںʱӵļ~\texttt{\~{}/logout-time}~С

    ʹһʹôڹʱ~X~˳ĳ%
\index{exiting!X windows system}\index{quitting!X windows system}%
\index{X windows system!exiting}\index{GUIs!X windows system!exiting}

\begin{lyxcode}\standardtilde
xclock~\&

fvwm~\&

exec~xterm
\end{lyxcode}
    ýűں̨~\texttt{xclock}~~\texttt{fvwm}Ȼʹ~%
\texttt{xterm}~滻Լ˳~\texttt{xterm}~ʱ~X~Ự̼%
\index{exiting!X windows system}\index{quitting!X windows system}%
\index{X windows system!exiting}\index{GUIs!X windows system!exiting}

    õѧϰʹ~\texttt{.xsession}~ķǳһЩĽ
⣬ȷʹ~\texttt{chmod}~ʹִ֮Уִд˲ǾĴ
