\documentclass[letterpaper]{article}
\nonstopmode
\akai
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage{t1enc}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{null}
\def\addbibtoc{
\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
}%end-preamble
\setcounter{page}{1}
\title{Linux ÖÕ¶Ë»úÏÂµÄ²ÊÉ«ÏÔÊ¾}
\author{×÷Õß: Thorbj\o{}rn Ravn Andersen, {\ttfamily ravn@dit.ou.dk}\\ 
        ÒëÕß: Chou-Kai Wang, {\ttfamily stylon@ms2.hinet.net}}
\date{v1.4, 7 August 1997}
\abstract{ËäÈ»´ó²¿·ÝµÄ Linux ·¢ÐÐ°æ±¾¶¼¸½ÓÐÒ»¸öÓÃÀ´°ÑÄ¿Â¼µÄÄÚÈÝÁÐ³öÀ´£¬¶øÇÒ¿ÉÒÔÀûÓÃ²ÊÉ«À´ÔöÇ¿Êä³öÔÚÊÓ¾õÉÏµÄÐ§¹ûµÄ'{\ttfamily ls}'Ö¸Áî£¬²»¹ýÒª°ÑËûÉè¶¨µÄºÏÄãÒâÈ´²»ÊÇ¼þÈÝÒ×µÄÊÂ¡£Õâ·ÝÎÄ¼þËµÃ÷ÁËÉè¶¨Ò»Ð©ÒÑ¾­ÄÚ¸½ÔÚÄãµÄ Linux ·¢ÐÐ°æ±¾µÄÈíÌå£¬À´´ïµ½Õâ¸öÄ¿µØµÄºÃ¼¸ÖÖ²»Í¬µÄ·½·¨£¬»¹ÓÐÔÚÄÇ¡õ¿ÉÒÔÕÒµ½Ò»Ð©ÔÚ´ó²¿·Ý°æ±¾µÄ Unix ¡õ¶¼»áÓÃµ½£¬µ«ÊÇÈ´³£³£²»±»¸½ÔÚ Slackware »ò RedHat Linux ¡õµÄÈíÌå¡£Õâ·ÝÎÄ¼þµÄ HTML °æ±¾Ò²¿ÉÒÔÔÚÎÒµÄÔ­Ê¼µµ°¸Õâ¡õ\nameurl{http://www.mip.ou.dk/~ravn/colour-ls}{} ÕÒµÄµ½¡£}


\begin{document}
\maketitle
\tableofcontents

\section{¼ò½é}

ÕâÐ©ÄêÀ´²ÊÉ«µÄÏÔÊ¾Æ÷ÒÑ¾­Ïàµ±ÆÕ±é£¬Ê¹ÓÃÕßÒ²¿ªÊ¼Ê¹ÓÃÒ»Ð©ÒÔ²ÊÉ«À´±íÊ¾ÀýÈç£º³ÌÊ½ÓïÑÔ¡õµÄ±£Áô×Ö£¬»òÊÇÆ´´íµÄ×Ö£¬À´¸øÊ¹ÓÃÕßÒ»Ð©ÊÓ¾õÉÏµÄ»ØÀ¡¡£

×Ô´Ó Linux µÄÎÄ×ÖÄ£Ê½¿ØÖÆÌ¨Ö§Ô®²ÊÉ«áá£¬Ô­À´µÄ GNU ls Ò²ºÜ¿ìµÄ±»ÐÞ¸Ä³ÉÖ§Ô®Êä³ö²ÊÉ«µÄÑ¶Ï¢¶øÇÒ±»¸½ÔÚ Slackware 2.0 °æ¡õ¡£
ÕâÐ©¸ÄÁ¼Ô­À´°æ±¾µÄ×º²¹µµ°¸ÒÑ¾­±»ÕûºÏµ½±ê×¼°æµÄ GNU ls Àï£¬ÏÖÔÚÒ²Ó¦¸ÃÊÇËùÓÐÐÂµÄ Linux ·¢ÐÐ°æ±¾µÄÒ»²¿·ÝÁË¡£

ÏÖÔÚÕâ°æ±¾µÄÎÄ¼þÊÇ°Ñ×î³õµÄ°æ±¾¸ÄÐ´ÁËÐí¶à²¿·Ýáá¸üÐÂ¶øÀ´µÄ£¬°üÀ¨ÁËÒ»Ð©¹Øì¶ xterm ºÍ ÈçºÎÀûÓÃ×º²¹µµÀ´¸üÐÂºËÐÄµÄ×ÊÑ¶¡£

Õâ·ÝÎÄ¼þÀïµÄ×ÊÑ¶¶¼ÔÚ Redhat 4.1 ¡õÑéÖ¤¹ý£¬¶øÇÒÖ÷ÒªÊÇÔÚSlackware 2.0.2 °æ¼°ºËÐÄ°æ±¾ 1.1.54 µÄ»·¾³¡õËÑ¼¯¶øÀ´µÄ¡£
ºËÐÄµÄ×º²¹µµµÄ×ÊÑ¶ÊÇÔÚ slackware 2.2.0£¬1.2.13 °æµÄºËÐÄ£¬²¢ÇÒÒÔ tcsh ÎªÔ¤ÉèµÄ shellµÄ»·¾³¡õÈ¡µÃµÄ£¬
¶øááÀ´Ò²ÔÚ 2.0.27 µÄºËÐÄ¡õÑéÖ¤¹ý¡£Èç¹ûÄãÊ¹ÓÃÆäËüµÄÉè¶¨»òÊÇ unix °æ±¾£¬ÎÒ»áºÜ¸Ð¼¤Äã¸æËßÎÒÄãµÄ×÷ÒµÏµÍ³¼°°æ±¾£¬
»¹ÓÐËüÊÇ·ñÖ§Ô®²ÊÉ«µÄÏÔÊ¾¡£




\section{¿ìËÙÈëÃÅ£º¸øÃ»ÓÐÄÇ÷á¶àÄÍÐÄµÄ¶ÁÕß}

Èç¹ûÄãÓÐ¸ö {\itshape ÐÂ°æµÄ\/} Linux£¬¶ÔÄãÊ¹ÓÃÕßÄ¿Â¼ÏÂµÄÕâÐ©µµ°¸×÷ÕâÐ©ÐÞ¸Ä£¬ÏÂ´ÎÄãµÇÈëµÄÊ±ºò¾Í»áÉúÐ§ÁË¡£

\begin{tscreen}
\begin{verbatim}
~/.bashrc:
    alias ls="ls --color"

~/.cshrc:
    alias ls 'ls --color'
    
\end{verbatim}
\end{tscreen}

ÕâÑù¾ÍºÃÀ²£¡

ÄãÒ²Ðí»¹»áÏëÒª×÷£º``{\ttfamily eval `dircolors \$HOME/.colourrc`}''£¬
À´Éè¶¨Äã×Ô¼ºÏëÒªµÄÑÕÉ«¡£Õâ¸öµµ°¸¿ÉÒÔÓÃ ``{\ttfamily dircolors -p {$>$}\$HOME/.colourrc}''
À´ÖÆÔì³öÀ´£¬¶øÇÒ¡õÃæÓÐÐí¶àµÄ×¢½â·½±ãÄã¸ü¸ÄÉè¶¨¡£




\section{ÕâÑù¾ÍºÃÁËÂð?}



Ê×ÏÈÄãÐèÒªÖªµÀÄãÊ¹ÓÃµÄ {\ttfamily ls} ÊÇ²»ÊÇ¿ÉÒÔÊÊµ±µÄ´¦Àí²ÊÉ«Êä³ö¡£ÔÚ Linux µÄÎÄ×ÖÄ£Ê½¿ØÖÆÌ¨ÊÔÊÔ¿´Õâ¸öÖ¸Áî(ÔÚ xterm ¡õÒ²¿ÉÒÔ):

\begin{tscreen}
\begin{verbatim}
% ls --color
\end{verbatim}
\end{tscreen}


(Õâ¡õµÄ {\ttfamily \%} ÊÇ shell µÄÌáÊ¾·ûºÅ):

Èç¹ûÄã¿´µ½ÁË±íÊ¾ÄãµÄ {\ttfamily ls} ²»ÄÜ½ÓÊÜÕâ¸öÑ¡ÏîµÄ´íÎóÑ¶Ï¢£¬ÄÇÄãÓ¦¸Ã°²×°ÐÂ°æ±¾µÄ GNU fileutils ÈíÌå¡£Èç¹ûÄãÊ¹ÓÃµÄ·¢ÐÐ°æ±¾Ã»ÓÐÌá¹©ÐÂµÄÉý¼¶ÈíÌå£¬ÄÇ÷á¾Í´Ó GNU µÄÓ³ÉäÕ¾Ì¨È¡µÃÕâ¸öÈíÌå²¢ÇÒÖ±½Ó´ÓÔ­Ê¼Âë°²×°¡£

Èç¹ûÄã²¢{\itshape Ã»ÓÐ\/}¿´µ½´íÎóÑ¶Ï¢£¬ÄÇ÷áÄãÊ¹ÓÃµÄ {\ttfamily ls} ±ã¿ÉÒÔ½ÓÊÜÕâ¸öÑ¡Ïî¡£µ«ºÜ²»ÐÒµÄ£¬ÓÐÒ»Ð©ÔÚ Slackware (ÆäËüµÄ·¢ÐÐ°æ±¾Ò²ÓÐ¿ÉÄÜ) ¡õ¸½µÄÔçÆÚ°æ±¾ÊÇÓÐ³ô¡õµÄ¡£ÔÚ Redhat 4.1 ¡õÃæ¸½µÄ 3.13 °æµÄ {\ttfamily ls} ¾ÍÃ»ÓÐÎÊÌâ¡£

\begin{tscreen}
\begin{verbatim}
% ls --version
ls - GNU fileutils-3.13
\end{verbatim}
\end{tscreen}


Èç¹ûÄãÔÚ Linux µÄÎÄ×ÖÄ£Ê½ÖÕ¶Ë»ú¡õÖ´ÐÐ ``{\ttfamily ls --color}''£¬ÄÇ÷áËüµÄÊä³öÓ¦¸ÃÒÀÕÕÏµÍ³µÄÔ¤ÉèÖµ¶øÓÐÊÊµ±µÄ²ÊÉ«£¬¶øÇÒÄãÏÖÔÚ¿ÉÒÔ¿ªÊ¼¾ö¶¨ÊÇ²»ÊÇÐèÒª¸Ä±äÈÎºÎµÄÉè¶¨¡£

Èç¹ûÄãÔÚ xterm ¡õÖ´ÐÐÉÏÃæµÄ¹ý³Ì£¬Ò²ÐíÄã»¹ÊÇÃ»°ì·¨¿´µ½Êä³ö±ä³É²ÊÉ«¡£¾Í¸ú {\ttfamily ls} Ò»Ñù£¬Ô­À´µÄ xterm ²¢²»Ö§Ô®Ó¦ÓÃ³ÌÊ½µÄ²ÊÉ«Êä³ö£¬¶ø½ÏÐÂµÄ°æ±¾ÓÐÖ§Ô®¡£Èç¹ûÄãµÄ xterm ²»Ö§Ô®²ÊÉ«£¬ÄÇ÷áÇë²Î¿¼Õâ¸öÎÄ¼þµÄ½áÎ²ÄÃµ½½ÏÐÂ°æ±¾µÄ xterm£¬Í¬Ê±ÄãÒ²Ö»ºÃÇÐ»»µ½ÎÄ×ÖÄ£Ê½²¢ÇÒ¼ÌÐøÏÂÃæµÄ²½Öè¡£




\section{ÓÐÄÇÐ©ÑÕÉ«¿ÉÒÔÑ¡ÔñÄØ?}

ÏÂÃæµÄ shell ÃüÁî¸å(¸ÐÐ»Ðí¶à°Ñ bash µÄ°æ±¾¼Ä¸øÎÒµÄÈË)ÏÔÊ¾³öÏÖÔÚÊ¹ÓÃµÄÖ÷¿ØÌ¨ÄÜ¹»Ö§Ô®µÄ¸÷ÖÖÑÕÉ«×éºÏ¡£Èç¹ûÃ»ÓÐÑÕÉ«³öÏÖ£¬ÄÇ÷áÄãµÄÖ÷¿ØÌ¨¾Í²»Ö§Ô® ANSI µÄÑÕÉ«Ñ¡Ôñ¡£

\begin{tscreen}
\begin{verbatim}
#!/bin/bash
# ÏÔÊ¾ ANSI µÄ²ÊÉ«
#
esc="\033["
echo -n " _ _ _ _ _40 _ _ _ 41_ _ _ _42 _ _ _ 43" 
echo "_ _ _ 44_ _ _ _45 _ _ _ 46_ _ _ _47 _"
for fore in 30 31 32 33 34 35 36 37; do
  line1="$fore  " 
  line2="    "
  for back in 40 41 42 43 44 45 46 47; do
    line1="${line1}${esc}${back};${fore}m Normal  ${esc}0m"
    line2="${line2}${esc}${back};${fore};1m Bold    ${esc}0m"
  done
  echo -e "$line1\n$line2"
done
\end{verbatim}
\end{tscreen}


Ç°¾°µÄÑÕÉ«ºÅÂëÊÇÔÚ×ó±ßÄÇÒ»ÅÅ£¬±³¾°µÄÔòÊÇÔÚÉÏ·½¡£Èç¹ûÄãÒª´ÖÌåµÄ×ÖÔªºÍ¸ßÁÁ¶È¾ÍÔÚ²ÎÊý¡õ¼ÓÒ»¸ö "1"£¬ËùÒÔÇ°¾°ÊÇ°×É«¶ø±³¾°ÊÇÀ¶É«¾Í³ÉÁË "37;44;1"¡£Õû¸öµÄ ANSI ÑÕÉ«Ñ¡ÔñÐòÁÐ¾ÍÊÇ 
\begin{verbatim}
ESC [ 3 7 ; 4 4 ; 1 m
\end{verbatim}
 ¡£

×¢: ±³¾°²»¿ÉÒÔÊÇ¸ßÁÁ¶È£¬ËùÒÔ»ÆÉ«(¸ßÁÁ¶ÈµÄ×ØÉ«)Ö»ÄÜÓÃÀ´×÷Ç°¾°¡£ÕâÊÇÓ²ÌåÉÏµÄÏÞÖÆ¡£

\begin{verbatim}
ÑÕÉ«´úÂë:
        0 - ºÚÉ«     4 - À¶É«           3# ÊÇ±³¾°ÑÕÉ«
        1 - ºìÉ«     5 - ·ÛºìÉ«         4# ÊÇÇ°¾°ÑÕÉ«
        2 - ÂÌÉ«     6 - ÇàÉ«
        3 - »ÆÉ«     7 - °×É«           ;1 ÊÇ´ÖÌåºÍ¸ßÁÁ¶È
\end{verbatim}





\section{ÈçºÎÉè¶¨ ls µÄ²ÊÉ«Êä³ö}



Èç¹ûÄãÏëÒªÐÞ¸Ä {\ttfamily ls} ÄÚ¶¨µÄ±ê×¼ÑÕÉ«£¬ÄãÐèÒªÓÃÏÂÃæµÄÖ¸ÁîÔÚÄãµÄ HOME Ä¿Â¼ÏÂÖÆÔìÕâÒ»¸öµµ°¸
\begin{tscreen}
\begin{verbatim}
 cd ; dircolors -p > .coloursrc 
\end{verbatim}
\end{tscreen}


ÔÚÄã±à¼­ÍêÕâ¸ö×¢½âµÄºÜÏêÏ¸µÄµµ°¸ÒÔáá£¬Äã±ØÐèÒª°ÑËü¶Á½øÄãµÄ»·¾³±äÊý LS\_COLORS ¡õ£¬Í¨³£¶¼ÊÇÕâÑù×÷µÄ
\begin{tscreen}
\begin{verbatim}
eval `dircolors .colourrc`
\end{verbatim}
\end{tscreen}

È»ááÄãÒª°ÑÇ°ÃæÕâÒ»ÐÐ·Å½øÄãµÄ .bashrc »ò .cshrc »ò .tcshrc (ÒÀÕÕÄãÊ¹ÓÃµÄ shell ¶ø¶¨)¡õ¡£¸üÏêÏ¸µÄÓÃ·¨Çë¿´ dircolors(1) µÄÊ¹ÓÃËµÃ÷¡£






\section{ÈçºÎ¸Ä±äÏµÍ³µÄÔ¤ÉèÖµ: Ç°¾°°×É«¶ø±³¾°ÊÇºÚÉ«}





ÄãÐèÒª¸æËßÄãµÄÖÕ¶Ë»úÇý¶¯³ÌÊ½ÄãÏëÒªµÄÁíÒ»¸öÔ¤ÉèÖµ¡£ÒªÈçºÎ×÷²¢Ã»ÓÐÒ»¸ö±ê×¼µÄ·½·¨£¬²»¹ýÈç¹ûÄãÊÇÓÃ Linux µÄ»°£¬ÄãÓÐ setterm Õâ¸ö³ÌÊ½¿ÉÒÔÓÃ¡£



"setterm" Ê¹ÓÃÖÕ¶Ë»ú×ÊÁÏ¿â¡õµÄ×ÊÁÏÀ´Éè¶¨ÊôÐÔ¡£ÒªÑ¡ÔñÊôÐÔµÄ»°ÒªÕâÑù×÷
\begin{tscreen}
\begin{verbatim}
setterm -foreground black -background white -store
\end{verbatim}
\end{tscreen}




"-store" ²ÎÊý°ÑÏÖÔÚËù×÷µÄ¸Ä±äÉè¶¨³ÉÔ¤ÉèÖµ¡£ÕâÐèÒªÄãÏÖÔÚÊ¹ÓÃµÄµÄÖÕ¶Ë»úÖÖÀà(ÔÚ TERM »·¾³±äÊý¡õ)ÔÚ termcap ×ÊÁÏ¿â¡õÓÐ×ã¹»ÏêÏ¸µÄ¼ÍÂ¼¡£Èç¹û setterm ÒòÎªÄ³ÖÖÒòËØ²»ÄÜÕý³£µÄ¹¤×÷£¬Äã»¹ÓÐÆäËüµÄÑ¡Ôñ¡£






\subsection{Xterm}



ÄãÒªÓÐÖÁÉÙÒ»ÖÖÏÂÁÐµÄ xterm£¬¶øÇÒÒªÖ§Ô®²ÊÉ«¡£

\begin{tscreen}
\begin{verbatim}
xterm -fg white -bg blue4
color_xterm -fg white -bg blue4
color-xterm -fg white -bg blue4
nxterm -fg white -bg blue4
\end{verbatim}
\end{tscreen}


Õâ¡õµÄ 'color\_xterm' Ö§Ô®²ÊÉ«°æµÄ 'ls'¡£Õâ¡õµÄÑÕÉ«Ñ¡ÔñÊÇÄ£áÝ SGI ÉÏÃæÊ¹ÓÃµÄÑÕÉ«¡£




\subsection{ÐéÄâÖ÷¿ØÌ¨}



ÄãÒ²¿ÉÒÔÐÞ¸ÄºËÐÄ£¬ÕâÑù¾Í¿ÉÒÔÒ»ÀÍÓÀÒÝµÄÓÃ¿ØÖÆÂëÀ´¸Ä±äÐéÄâÖ÷¿ØÌ¨µÄÔ¤ÉèÖµ¡£Èç¹ûÄã×Ô¼º±àÒëºËÐÄµÄ»°£¬ÎÒ½¨ÒéÀûÓÃ kernel µÄ×º²¹µµ¡£



ºËÐÄµÄÔ­Ê¼ÂëÊÇÔÚ {\ttfamily /usr/src/linux/drivers/char/console.c} £¬´ó¸ÅÔÚ 1940 ÐÐ£¬ÕâÊÇÄãÓ¦¸ÃÐÞ¸ÄµÄµØ·½

\begin{tscreen}
\begin{verbatim}
        def_color       = 0x07;   /* white */
        ulcolor         = 0x0f;   /* bold white */
        halfcolor       = 0x08;   /* grey */
\end{verbatim}
\end{tscreen}

\begin{tscreen}
\begin{verbatim}
        def_color       = 0x17;   /* white */
        ulcolor         = 0x1f;   /* bold white */
        halfcolor       = 0x18;   /* grey */
\end{verbatim}
\end{tscreen}


Õâ±ßµÄÊ®Áù½øÎ»Êý×ÖÊÇ¸øÏÔÊ¾¿¨ÓÃµÄ: ×î×ó±ßµÄÎ»Ôª(ÉÏÃæ¡õÀýµÄ "1")ÊÇ±³¾° ; ×îÓÒ±ßµÄÎ»ÔªÊÇÇ°¾°¡£0 = ºÚÉ«£¬1 = À¶É«£¬2 = ÂÌÉ«£¬3 = ÇàÉ«,  4 = ºìÉ«, 5 = ×ÏÉ«£¬6 = ×ØÉ«/»ÆÉ«£¬7 = °×É«¡£°ÑÊý×Ö¼Ó 8 ¿ÉÒÔµÃµ½¸ßÁÁ¶ÈµÄÑÕÉ«¡£ÔÚ´ó²¿·ÝµÄÇé¿öÏÂ£¬¸ßÁÁ¶ÈµÄ±³¾°É« == ÉÁË¸µÄ×Ö¼ÓÉÏÆÕÍ¨µÄ±³¾°¡£
ÓÉ \nameurl{mailto:sjlam1@mda023.cc.monash.edu.au}{sjlam1@mda023.cc.monash.edu.au} ËùÌá¹©



ÄãÒ²¿ÉÒÔÊ¹ÓÃÏÂÃæµÄ ANSI ¿ØÖÆÂëÌá¹©Ò»¸öÖ´ÐÐÊ±ÆÚµÄÖ÷¿ØÌ¨Ô¤ÉèÖµ¡£(ÔÚºËÐÄÔ­Ê¼Âë¡õÕÒµ½µÄ)
\begin{tscreen}
\begin{verbatim}
        ESC [ 8 ]
\end{verbatim}
\end{tscreen}


Õâ¸ö¿ØÖÆÂë°ÑÔ¤ÉèÖµÉè³ÉÄ¿Ç°µÄÇ°¾°¼°±³¾°ÑÕÉ«¡£È»ááÖØÉèÊôÐÔµÄ¿ØÖÆÂë(ESC [ m)ÈÃÕâÔ¤ÉèÖµÂíÉÏ¾ÍÈ¡´úºÚ°×É«³ÉÎªÊ¹ÓÃÖÐµÄÑÕÉ«¡£

Ã¿´ÎÄãÖØ¿ª»úµÄÊ±ºîÄã¶¼ÐèÒªÔÙ°ÑÕâÐ©×Ö´®ËÍ¸øÖ÷¿ØÌ¨¡£ÒÀÕÕÄãµÄ Linux Ö÷»úÓÃÍ¾²»Í¬£¬ÓÐºÃ¼¸¸öµµ°¸¿ÉÒÔ´ï³ÉÕâ¸öÄ¿µÄ¡£




\subsubsection{/etc/issue}





ÔÚ Slackware ¡õÕâ¾ÍÊÇ "Welcome to Linux xx.yy" Ñ¶Ï¢ËùÔÚµÄµµ°¸£¬Èç¹ûÄãµÄÖ÷»úÊÇ¸öÈËÊ¹ÓÃµÄ»°£¬´ÓÕâ¸öµµ°¸ÏÂÊÖÊÇ²»´íµÄÑ¡Ôñ(µ«¶Ôì¶ÓÃ telnet Ô¶¶ËµÇÈëÊ¹ÓÃÏµÍ³µÄÈË¾Í¿ÉÄÜÓÐµãÌÖÑá)¡£
Õâ¸öµµ°¸ÔÚÃ¿´Î¿ª»úµÄÊ±ºî¶¼»á±»ÖÆÔì³öÀ´£¬Ô­À´µÄÄÚÈÝÔò±»¸²¸Ç£¬ËùÒÔÄã±ØÐèÒªÐÞ¸Ä¿ª»úµµ°¸(ÔÚ Slackware ¡õÊÇ /etc/rc.d/rc.S£¬Redhat¡õÊÇ /etc/rc.d/rc.local)¡õÃæµÄÏÂÁÐ¼¸ÐÐ:

\begin{tscreen}
\begin{verbatim}
  echo ""> /etc/issue
  echo Welcome to Linux `/bin/uname -a | /bin/cut -d\  -f3`. >> /etc/issue
\end{verbatim}
\end{tscreen}

¸Ä³É
\begin{tscreen}
\begin{verbatim}
  ESCAPE="ÔÚÕâ¡õ·ÅÈë ESC Âë"
  echo "${ESCAPE}[H${ESCAPE}[37;44m${ESCAPE}[8]${ESCAPE}[2J"> /etc/issue
  echo Welcome to Linux `/bin/uname -a | /bin/cut -d\  -f3`. >> /etc/issue
\end{verbatim}
\end{tscreen}


Õâ¡õµÄ¿ØÖÆÂë»á°ÑÓÎ±ê¹éÎ»¡¢Éè¶¨ÑÕÉ«(ÔÚÕâ¡õµÄÇ°¾°ÊÇ°×É«¶ø±³¾°ÊÇÀ¶É«)¡¢°ÑÕâ¸öÉè¶¨´æÆðÀ´²¢ÇÒ°ÑÓ©Ä»ÉÏÆäËü²¿·ÝÇå³ýµô¡£
Õâ¡õµÄ¸Ä±ä»áÔÚÏÂ´ÎÖØ¿ª»úÊ±ÉúÐ§¡£±ðÍüÁËÔÚ emacs Òª´òÈë ESC ×ÖÔªÒª°´ C-q ¼ü¶øÔÚ vi ¡õÒª°´ control-v£¬ÒòÎªºÜÏÔÈ»µÄÖ´ÐÐÒÔÉÏ³ÌÊ½µÄ sh ²¢²»ÁË½â {\ttfamily /033} ÕâÖÖÓÃ·¨¡£




\subsubsection{/etc/profile »ò .profile}

\begin{tscreen}
\begin{verbatim}
  if [ "$TERM" = "console" ]; then
      echo "\033[37;44m\033[8]" #
# »òÊ¹ÓÃ setterm¡£
      setterm -foreground white -background blue -store
  fi
\end{verbatim}
\end{tscreen}





\subsubsection{/etc/login »ò .login}



\begin{tscreen}
\begin{verbatim}
  if ( "$TERM" == "console" ) then
    echo "\033[37;44m\033[8]"  
# »òÊ¹ÓÃ setterm¡£
      setterm -foreground white -background blue -store
  endif
\end{verbatim}
\end{tscreen}


{[} ÒëÕß×¢: Linux µÄÖ÷¿ØÌ¨ÏÂµÄ \$TERM »·¾³±äÊýÒÑ¾­ÊÇ "linux" ¶ø²»ÊÇ "console" ÁË ]




\subsection{Ô¶¶ËµÇÈë}



ÄãÓ¦¸Ã¿ÉÒÔÓÃÉÏÃæÊ¾¡õ¹ýµÄ setterm ³ÌÊ½¡£µ±È»£¬Ô¶¶ËµÄ»úÆ÷±ØÐèÒªÄÜ¹»µÃµ½×ã¹»µÄ×ÊÑ¶À´²Ù×÷ÄãµÄÖÕ¶Ë»ú£¬¶øÇÒÄãµÄÖÕ¶Ë»úÄ£Äâ³ÌÊ½ÒªÄÜ¹»Ö§Ô®²ÊÉ«¡£
ÔÚÎÒµÄ¾­Ñé¡õÆäËüÆ½Ì¨ÉÏ×îºÃµÄ vt100 ÖÕ¶Ë»úÄ£Äâ³ÌÊ½ÓÐÏÂÁÐ¼¸ÖÖ:
\begin{itemize}
\item MS-DOS:         MS-Kermit (Ãâ·Ñ, ²»ÊÇ Microsoft µÄ²úÆ·)
\item Windows 95/NT:  Kermit/95 (¹²ÏíÈíÌå)
\item OS/2:           Kermit/95 (¹²ÏíÈíÌå)¡£ Çë×¢Òâ±ê×¼µÄ telnet Ö§Ô®²ÊÉ«¶øÇÒ¿ÉÒÔÔÚ±¾µØ¶ËÉè¶¨¡£
\end{itemize}


¹Øì¶ kermit µÄÏ¸½ÚÇë¿´ \nameurl{http://www.columbia.edu/kermit/}{} 






\section{ÈíÌå}



ÒÔÉÏËùÓÐµÄÓÃ·¨¶¼¼ÙÉèÄãÊ¹ÓÃµÄÊÇ GNU/Linux¡£Èç¹ûÄãÊÇÊ¹ÓÃÆäËüµÄ×÷Òµ»·¾³(±ÈÈçËµÊÇÖ´ÐÐ X µÄ Sun ¹¤×÷Õ¾µÈµÈ)Äã»¹ÊÇ¿ÉÒÔÄÃµ½²¢ÇÒ×Ô¼º±àÒëÕâÐ©ÈíÌå¡£

²ÊÉ«°æµÄ xterm ÊÇ´Ó±ê×¼µÄ xterm Ô­Ê¼Âë¶ø·¢Õ¹À´µÄ£¬¶øÓÃÀ´ÐÞ¸Ä±ê×¼ xterm µÄ×º²¹µµ¿ÉÒÔ´ÓÈÎºÎÒ»¸ö X11R6 µÄÕ¾Ì¨»ñµÃ¡£
ÌýËµ R6.3 ÄÚ¸½µÄ xterm ÓÐÖ§Ô®²ÊÉ«£¬²»¹ýÎÒÃ»ÓÐ²âÊÔ¹ý¡£

\begin{tscreen}
\begin{verbatim}
ftp://ftp.denet.dk/pub/X11/contrib/utilities/color-xterm-R6pl5-patch.gz
\end{verbatim}
\end{tscreen}

Èç¹ûÄãÊÇÓÃ¾É°æµÄ X µÄ»°Çë¿´ÄÚ¸½µÄÎÄ¼þ¡£{\itshape ×¢Òâ:\/}
ÎÒ×Ô¼º²¢Ã»ÓÐ²âÊÔ¹ý!



'ls' ÊÇÄÚ¸½ÔÚ GNU µÄ fileutils ÈíÌå¡õ¶øÄã¿ÉÒÔ´Ó prep.mit.edu »òÆäËüµÄÓ³ÉäÕ¾Ì¨ÄÃµ½¡£ÇëÄÃ×îÐÂµÄ 3.13 °æ±¾¡£
\begin{tscreen}
\begin{verbatim}
ftp://ftp.denet.dk/pub/gnu/fileutils-3.XX.tar.gz
\end{verbatim}
\end{tscreen}




ÎÒ×Ô¼ºÔø¾­ÔÚ Solaris£¬SunOS£¬Irix ÉÏ³É¹¦±àÒë¹ý color-ls¡£



ÎÒºÜ»¶Ó­¶Ôì¶ÕâÆªÎÄÕÂµÄ»ØÓ¦¡£ÎÒµÄµç×ÓÓÊ¼þµØÖ·ÊÇ
\nameurl{mailto:ravn@dit.ou.dk}{ravn@dit.ou.dk}

--

Thorbj\o{}rn Ravn Andersen

\end{document}
