The Linux Tips HOWTO

Paul Anderson

paul@geeky1.ebtech.net

JF Project - 擔杮岅栿

JF@linux.or.jp

v3.6, June 1998

偙偺 HOWTO 偱偼丄堄奜偲抦傜傟偰偄側偄偪傚偭偲偟偨僸儞僩傗僐僣傪徯夘偟偰
偄傑偡丅偙傟傪抦傟偽丄Linux 偼傕偭偲曋棙偵側傞偼偢偱偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

Table of Contents
1. 偼偠傔偵
2. 抁偄 tips
   
    2.1. 偍庤寉 Syslog 僩儕僢僋乣Tips-HOWTO 娗棟恖 Paul Anderson
    2.2. 埑弅偝傟偨 HOWTO 暥彂傪昞帵偡傞僗僋儕僾僩乣Didier Juges,
        <dj@destin.nfds.net>
    2.3. 嬻偒僗儁乕僗偼廩暘偐丠丠丠乣Hans Zoebelein
        <zocki@goldfish.cube.net>
    2.4. 儘僌僼傽僀儖憒彍儐乕僥傿儕僥傿乣Paul Anderson, Tips-HOWTO 娗棟
        幰
    2.5. core 僼傽僀儖憒彍偺偍庤寉僗僋儕僾僩乣Otto Hammersmith
        <ohammers@cu-online.com>
    2.6. 堎側傞僼傽僀儖僔僗僥儉娫偱偺僨傿儗僋僩儕堏摦乣Alan Cox
        <A.Cox@swansea.ac.uk>
    2.7. 偳偺僨傿儗僋僩儕偑堦斣戝偒偄偐傪抦傞乣Mick Ghazey
        <mick@lowdown>
    2.8. Linux Gazette
    2.9. GNU Make 3.70 偺 VPATH 傑傢傝偺怳傞晳偄傪曄偊傞僷僢僠偺応強乣
        Ted Sterm <sterm@amath.washington.edu>
    2.10. 儕僽乕僩偺偨傃偵偄偪偄偪 fsck 偡傞偺傪傗傔偝偣傞偵偼丠乣Dale
        Lutz <dal@wimsey.com>
    2.11. 儕僽乕僩偺嵺丄"device busy" 偺偣偄偱 fsck 偝傟傞偺傪旔偗傞曽
        朄乣Jon Tombs <jon@gtex02.us.es>
    2.12. 僴乕僪僨傿僗僋忋偺堦斣戝偒側僼傽僀儖傪尒偮偗傞曽朄乣Simon
        Amor <simon@foobar.co.uk>
    2.13. 僷儞僠寠傪奐偗傞儅乕僕儞傪庢偭偰僾儕儞僩傾僂僩偡傞曽朄乣Mike
        Dickey <mdickey@thorplus.lib.purdue.edu>
    2.14. 摿掕偺惓婯昞尰傪巊偭偰僼傽僀儖僣儕乕傪専嶕偡傞曽朄乣Raul
        Deluth Miller <rockwell@nova.umd.edu>
    2.15. 僾儘僌儔儉偑彑庤偵嶌偭偨僶僢僋傾僢僾僼傽僀儖傗僆乕僩僙乕僽僼
        傽僀儖傪憒彍偡傞僗僋儕僾僩乣Barry Tolnas
        <tolnas@nestor.engr.utk.edu>
    2.16. 堦斣儊儌儕傪怘偭偰偄傞僾儘僙僗傪扵偡曽朄乣Simon Amor
        <simon@foobar.co.uk >
    2.17. C 僾儘僌儔儈儞僌岦偗偵 vi 傪偄偠傞乣Paul Anderson Tips-HOWTO
        娗棟幰
    2.18. ctags 傪巊偭偰丄僾儘僌儔儈儞僌傪傗傝傗偡偔偡傞曽朄
    2.19. Red Hat 偱 sendmail 偑婲摦帪偵 5 暘娫僴儞僌偡傞棟桼乣Paul
        Anderson <paul@geeky1.ebtech.net>
    2.20. Red Hat 偱 color-ls 傪巊偆偨傔偺愝掕曽朄乣Paul Anderson
        <paul@geeky1.ebtech.net>
    2.21. 摿掕偺娭悢偑 /usr/lib 偺偳偺儔僀僽儔儕偵偁傞偐扵偡曽朄乣Pawel
        Veselow <vps@unicorn.niimm.spb.su>
    2.22. C 偺娙扨側 test 僾儘僌儔儉傪僐儞僷僀儖偟偨偗傟偳丄幚峴偟偰傕
        壗傕弌椡偝傟側偄両
   
3. 徻偟偄 Tips
   
    3.1. Linux 偲 Windows 偱僗儚僢僾僷乕僥傿僔儑儞傪嫟桳偡傞曽朄乣Tony
        Acero <ace3@midway.uchicago.edu>
    3.2. 嶍彍偟偰偟傑偭偨僼傽僀儖傪側傫偲偐暅妶偝偣傞曽朄乣Michael
        Hamilton <michael@actrix.gen.nz>
    3.3. immutable(晄曄)僼儔僌偺巊偄曽乣Jim Dennis <jadestar@rahul.net>
    3.4. 怴偟偄儌僲傪擖傟傞応強偵偮偄偰偺採尵乣Jim Dennis
        <jadestr@rahul.net>
    3.5. 僨傿儗僋僩儕撪偺僼傽僀儖柤傪彫暥帤偵曄姺偡傞乣Justin Dossey
        <dossey@ou.edu>
    3.6. Sendmail 傪傾僢僾僌儗乕僪偡傞曽朄乣Paul Anderson
        <paul@geeky1.ebtech.net >
    3.7. 怴恖僔僗僥儉娗棟幰偺偨傔偺 tips 乣Jim Dennis
        <jadestar@rahul.net>
    3.8. xdm 偱 X 僒乕僶偺儂僗僩慖戰偑偱偒傞傛偆偵偡傞愝掕曽朄乣Arrigo
        Triulzi <a.triulzi@ic.ac.uk>
   
4. 擔杮岅栿偵偮偄偰

1. 偼偠傔偵

傛偆偙偦 Linux Tips HOWTO 傊丅偙傟偼丄Linux 偑傕偭偲妝偟偔側傞彫儚僓傗
偪傚偭偲偟偨嵟揔壔偺曽朄傪廤傔偨暥彂偱偡丅偄傑偺偲偙傠丄偙偙偱徯夘偡傞
偺偼傢偨偟偑巚偄偮偔尷傝偺 tips 偲丄媽斉 Tips-HOWTO 偐傜揮嵹偟偨 tips
偱偡(愭恖偺抦宐偼攓庁偡傋偒側偺偱偡)丅偍婥偵擖傝偺儚僓傗 tips 偑偁偭偨
傜壗偱傕憲偭偰偔偩偝偄丅Tips-HOWTO 偺師偺斉偱徯夘偟傑偡丅

Paul Anderson Linux TIPS HOWTO 偺娗棟幰

<panderso@ebtech.net>

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2. 抁偄 tips

2.1. 偍庤寉 Syslog 僩儕僢僋乣Tips-HOWTO 娗棟恖 Paul Anderson

/etc/syslog.conf 傪曇廤偟偰丄師偺峴傪擖傟傑偡丅

  # Dump everything on tty8                                            
  *.*                                   /dev/tty8                      

拲堄帠崁丗昁偢 Tab 傪巊偆偙偲両 syslog 偼僗儁乕僗傪寵偄傑偡.....

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.2. 埑弅偝傟偨 HOWTO 暥彂傪昞帵偡傞僗僋儕僾僩乣Didier Juges,
<dj@destin.nfds.net>

弶怱幰偺傢偨偟偐傜摨偠偔弶怱幰偺傂偲岦偗偵丄HOWTO 暥彂偺専嶕偲昞帵偑娙
扨偵偱偒傞抁偄僗僋儕僾僩傪徯夘偟傑偡丅偨偲偊偽丄傢偨偟偺娐嫬偩偲 HOWTO
暥彂偼 /usr/doc/faq/howto/ 偵埑弅偝傟偰擖偭偰偄傑偡丅偙偙偱丄暥彂偺僼傽
僀儖柤偼丄XXX-HOWTO.gz 偱偁傝丄XXX 偺晹暘偼偦偺戣柤偲偟傑偡丅傢偨偟偼丄
師偺傛偆側 "howto" 偲偄偆僗僋儕僾僩傪嶌惉偟偰丄/usr/local/sbin 偵抲偒傑
偟偨丅

  #!/bin/sh                                                            
  if [ "$1" = "" ]; then                                               
      ls /usr/doc/faq/howto | less                                     
  else                                                                 
      gunzip -c /usr/doc/faq/howto/$1-HOWTO.gz | less                  
  fi                                                                   

堷悢側偟偱僐儅儞僪傪幚峴偡傞偲丄僨傿儗僋僩儕撪偵偁傞 HOWTO 慡晹傪昞帵偟
傑偡丅師偵丄堷悢偲偟偰僼傽僀儖柤偺嵟弶偺晹暘(僴僀僼儞傛傝嵍懁)傪擖椡偡
傞偲丄 (傕偲偺暥彂帺懱偵偼曄峏傪壛偊偢偵)偦偺暥彂傪夝搥偟偰丄昞帵偟傑偡
丅

偨偲偊偽丄Serial-HOWTO.gz 傪昞帵偡傞応崌偼丄師偺傛偆偵擖椡偟傑偡丅

  $ howto Serial                                                       

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.3. 嬻偒僗儁乕僗偼廩暘偐丠丠丠乣Hans Zoebelein
<zocki@goldfish.cube.net>

儅僂儞僩偝傟偰偄傞僨僶僀僗(僨傿僗僋丄CD-ROM丄僼儘僢僺乕...)忋偵廩暘側嬻
偒僗儁乕僗偑偁傞偐偳偆偐掕婜揑偵僠僃僢僋偡傞抁偄僗僋儕僾僩丅

嬻偒僗儁乕僗偑柍偔側傞偲丄X 昩偛偲偵儊僢僙乕僕偑昞帵偝傟丄枮攖偺僨僶僀
僗偑惗偠傞偨傃偵 1 捠偺儊乕儖偑撏偒傑偡丅

  #!/bin/sh                                                                                                        
                                                                                                                   
  #                                                                                                                
  # $Id: Tips-HOWTO.sgml,v 1.4 2001/07/21 14:58:17 senda Exp $                                                     
  #                                                                                                                
                                                                                                                   
  #                                                                                                                
  # 僨傿僗僋偑堦帪僼傽僀儖偱枮攖偵側傞偲丄僐儞僷僀儖拞偵婏柇側儊僢僙乕僕偑                                         
  # 昞帵偝傟傞傛偆偵側偭偨偺偱丄偙傟傪彂偄偰丄僨傿僗僋偑枮攖偵側傞慜偵寈崘                                         
  # 偑昞帵偝傟傞傛偆偵偟偨丅                                                                                       
  #                                                                                                                
  # 偙偺僗僋儕僾僩偱孨偺僒乕僶偑敋敪傪柶傟偨側傜丄杔偵偍楃偺儊乕儖傪                                               
  # 憲偭偰偪傚偆偩偄 zocki@goldfish.cube.net                                                                       
  # 偙偺僗僋儕僾僩偱孨偺僒僀僩偑慡柵偟偨側傜丄偍婥偺撆偱偡偑丄偍偄偟偄                                             
  # 榖偼偦偆側偄傕偺偱偡丅愑擟偼晧偊傑偣傫丅                                                                       
  # sed 偺埖偄偵廗弉偝傟偰偄傞曽丄偍偍傔偵尒偰偩偝偄丅:)                                                           
  #                                                                                                                
                                                                                                                   
  #                                                                                                                
  # 帺摦壔偡傞曽朄丗rc.local 偵 'check_hdspace &' 偲婰弎偡傞偙偲丅                                                 
  # $SLEEPTIME 昩偛偲偵僨傿僗僋忋偺嬻偒僗儁乕僗傪僠僃僢僋偟傑偡丅                                                  
  # 僼儘僢僺乕傗僥乕僾僪儔僀僽傕僠僃僢僋偱偒傑偡丅:)                                                               
  # 嬻偒僗儁乕僗偑 $MINFREE (kb) 埲壓偵側傞偲丄寈崘儊僢僙乕僕傪昞帵偟丄                                            
  # 栤戣偺偁傞僨僶僀僗偛偲偵 1 捠偺儊乕儖傪 $MAIL_TO_ME 偵憲怣偟傑偡丅                                             
  # 婎弨抣埲忋偺嬻偒僗儁乕僗偑妋曐偝傟傞偲丄嵞搙僗儁乕僗晄懌偵側偭偨                                               
  # 応崌偵旛偊偰丄儊乕儖憲怣婡擻偑弨旛偝傟傑偡丅                                                                   
  #                                                                                                                
                                                                                                                   
  # TODO: 僨僶僀僗偛偲偵堎側傞 $MINFREE 傪愝掕偱偒傞傛偆偵偡傞偙偲丅                                               
  # 嬻偒僗儁乕僗偑側偔側偭偨応崌丄/*tmp 僨傿儗僋僩儕偺僑儈僼傽僀儖傪                                               
  # 憒彍偟偰丄嬻偒僗儁乕僗傪嶌傞傛偆偵偡傞偙偲丅                                                                   
                                                                                                                   
                                                                                                                   
  DEVICES='/dev/sda2 /dev/sda8 /dev/sda9'         # 僨僶僀僗; 僨傿僗僋偺愝掕                                       
  MINFREE=20480                                   # kb; 偙傟埲壓偱寈崘昞帵                                         
  SLEEPTIME=10                                    # 昩; 僠僃僢僋偺娫妘                                             
  MAIL_TO_ME='root@localhost'                     # 扤偐; 寈崘儊乕儖偺憲怣愭                                       
                                                                                                                   
                                                                                                                   
  # ------- 偙傟埲壓偺晹暘偼丄曄峏偡傞昁梫偑偁傝傑偣傫 (婓朷) :) -------                                           
                                                                                                                   
  MINMB=0                                                                                                          
  ISFREE=0                                                                                                         
  MAILED=""                                                                                                        
  let MINMB=$MINFREE/1024         # yep, we are strict :)                                                          
                                                                                                                   
  while [ 1 ]; do                                                                                                  
          DF="`/bin/df`"                                                                                           
                  for DEVICE in $DEVICES ; do                                                                      
                  ISFREE=`echo $DF | sed s#.\*$DEVICE" "\*[0-9]\*""\*[0-9]\*" "\*## | sed s#" ".\*##`              
                                                                                                                   
                  if [ $ISFREE -le $MINFREE ] ; then                                                               
                          let ISMB=$ISFREE/1024                                                                    
                          echo  "WARNING: $DEVICE only $ISMB mb free." >&2                                         
                          #echo "more stuff here" >&2                                                              
                          echo -e "\a\a\a\a"                                                                       
                                                                                                                   
                          if [ -z  "`echo $MAILED | grep -w $DEVICE`" ] ; then                                     
                                  echo "WARNING: $DEVICE only $ISMB mb free.      (Trigger is set to $MINMB mb)" \ 
                                  | mail -s "WARNING: $DEVICE only $ISMB mb free!" $MAIL_TO_ME                     
                                  MAILEDH="$MAILED $DEVICE"                                                        
                                  MAILED=$MAILEDH                                                                  
                                  # put further action here like cleaning                                          
                                  # up */tmp dirs...                                                               
                          fi                                                                                       
                          elif [ -n  "`echo $MAILED | grep -w $DEVICE`" ] ; then                                   
                                  # Remove mailed marker if enough disk space                                      
                                  # again. So we are ready for new mailing action.                                 
                                  MAILEDH="`echo $MAILED  | sed s#$DEVICE##`"                                      
                                  MAILED=$MAILEDH                                                                  
                          fi                                                                                       
                                                                                                                   
                  done                                                                                             
                  sleep $SLEEPTIME                                                                                 
                                                                                                                   
  done                                                                                                             

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.4. 儘僌僼傽僀儖憒彍儐乕僥傿儕僥傿乣Paul Anderson, Tips-HOWTO 娗棟幰

傢偨偟偲撉幰偑摨偠娐嫬偵偁傞偲偡傞側傜丄撉幰偼 430 恖偺搊榐幰儕僗僩偲丄
擔偵 100 捠埲忋偺儊僢僙乕僕傪 UUCP 忋偱庴偗庢偭偰偄傞偼偢偱偡丅偙偆偄偆
応崌丄僴僢僇乕側傜偳偆傗偭偰偙偺嫄戝側儘僌傪張棟偡傞傫偱偟傚偆偐丠偦偆
丄 chklogs 傪僀儞僗僩乕儖偡傟偽偄偄偺偱偡丅 chklogs 偼 Emilio Grimaldo
<grimaldo@panama.iadhv.nl> 偑嶌惉偟偨傕偺偱丄嵟怴僶乕僕儑儞偺 1.8 偼丄
ftp.iaehv.nl:/pub/users/grimaldo/chklogs-1.8.tar.gz <ftp:iadhv.nl:/pub/
users/grimaldo/chklog-1.8.tar.gz> 偐傜擖庤偱偒傑偡丅側偵傛傝傕傑偢丄偙
傟傪僀儞僗僩乕儖偟傑偟傚偆(傕偪傠傫丄doc 僒僽僨傿儗僋僩儕偵偁傞 info 僼
傽僀儖傕僠僃僢僋偡傞偙偲)丅僀儞僗僩乕儖偑姰椆偟偨傜丄crontab 偵師偺峴傪
彂偒崬傫偱偔偩偝偄丅

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆  # Run chklogs at 9:00PM daily.                                    劆
劆  00 21 * * *       /usr/local/sbin/chklogs -m                      劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

嶌嬈偺偁偄傑偵丄偙偺僜僼僩僂僃傾偑偳傟傎偳慺惏傜偟偄偐嶌幰偵揱偊傞偺傪
朰傟側偄偱偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.5. core 僼傽僀儖憒彍偺偍庤寉僗僋儕僾僩乣Otto Hammersmith
<ohammers@cu-online.com>

師偺僗僋儕僾僩傪婰弎偟偨 rmcores 偲偄偆僼傽僀儖 ( 偙偺僾儘僌儔儉偺嶌幰
偼丄偙傟傪 handle-cores 偲屇傫偱偄傑偡) 傪嶌惉偟傑偡丅

  #!/bin/sh                                                            
  USAGE="$0  "                                                         
                                                                       
  if [ $# != 2 ] ; then                                                
          echo $USAGE                                                  
          exit                                                         
  fi                                                                   
                                                                       
   echo Deleting...                                                    
  find $1 -name core -atime 7 -print -type f -exec rm {} \;            
                                                                       
  echo e-mailing                                                       
  for name in `find $1 -name core -exec ls -l {} \; | cut -c16-24`     
  do                                                                   
          echo $name                                                   
          cat $2 | mail $name                                          
  done                                                                 

偦偟偰丄cron 偺僕儑僽偲偟偰丄偙傟傪掕婜揑偵婲摦偟偰偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.6. 堎側傞僼傽僀儖僔僗僥儉娫偱偺僨傿儗僋僩儕堏摦乣Alan Cox
<A.Cox@swansea.ac.uk>

偁傞僨傿僗僋偐傜懠偺僨傿僗僋傊丄僼傽僀儖僣儕乕傪娵偛偲偡偽傗偔堏摦偝偣
傞曽朄丅

  (cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xvfp -)

[帠屘偱僨傿儗僋僩儕傪僟儊偵偟偰偟傑傢側偄傛偆偵丄 cd /source/directory;
tar... 偺晹暘傪曄峏偟傑偟偨丅偙傟傪嫵偊偰偔傟偨 Jim Dennis
<jim@starshine.org> 丄偁傝偑偲偆丅乣娗棟恖 ]

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.7. 偳偺僨傿儗僋僩儕偑堦斣戝偒偄偐傪抦傞乣Mick Ghazey <mick@lowdown>

偍巊偄偺僐儞僺儏乕僞偱偳偺僨傿儗僋僩儕偑堦斣戝偒偄偐丠偭偰巚偭偨偙偲偼
偁傝傑偣傫偐丠師偺僐儅儞僪偱敾傝傑偡丅

  du -S | sort -n                                                      

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.8. Linux Gazette

Linux Gazette 偺憂姧幰丄John Fisk 偵塰梍偁傟両慺惏傜偟偄僆儞儔僀儞儅僈
僕儞偱偁傞偽偐傝偱側偔丄柍椏両両両側偺偱偡丅偙傟埲忋壗傪婜懸偟傑偡丠師
偺僒僀僩傪僠僃僢僋偟偰偔偩偝偄丅

http://www.linuxgazette.com <http://www.linuxgazette.com/>

尰嵼丄Linux Gazette 偼 (1) 寧姧偵側傝丄(2) John Fisk 偼婛偵曇廤傪戅偄偰
丄 SSC 偑堷偒宲偄偱偄傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.9. GNU Make 3.70 偺 VPATH 傑傢傝偺怳傞晳偄傪曄偊傞僷僢僠偺応強乣Ted
Sterm <sterm@amath.washington.edu>

偙偺栤戣傪書偊偰偄傞恖偑懡偄偐偳偆偐偼暘偐傝傑偣傫偑丄GNU Make 偺僶乕僕
儑儞 3.70 偵偼傢偨偟偺婥偵擖傜側偄乽摿挜乿偑偁傝傑偡丅VPATH 傪愨懳僷僗
柤偱梌偊偨応崌丄偍偐偟側摦嶌傪偡傞偺偱偡丅偙傟偵懳張偡傞偒傢傔偰埨掕偟
偨僷僢僠傪 Paul D. Smith <psmith@wellfleet.com> 偑採嫙偟偰偄傑偡丅傑偨
丄斵偼 GNU Make 偑峏怴偝傟傞偨傃偵丄僯儏乕僗僌儖乕僾 gnu.utils.bug 偵僪
僉儏儊儞僩偲僷僢僠傪搳峞偟偰偄傑偡丅傢偨偟偼丄傾僋僙僗偡傞僔僗僥儉偺傎
傏偡傋偰偺 gmake 偵偙偺僷僢僠傪摉偰偰嵞僐儞僷僀儖偟偰偄傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.10. 儕僽乕僩偺偨傃偵偄偪偄偪 fsck 偡傞偺傪傗傔偝偣傞偵偼丠乣Dale Lutz
<dal@wimsey.com>

Q丗僽乕僩偺偨傃偵 e2fsck 偑僨傿僗僋傪僠僃僢僋偟傑偡丅傗傔偝偣傞偵偼丠

僇乕僱儖傪嵞峔抸偡傞偲丄偦偺僼傽僀儖僔僗僥儉偼 "dirty" 偲儅乕僋偝傟丄偦
偺寢壥丄僽乕僩偺偨傃偵僨傿僗僋偑僠僃僢僋偝傟偰偟傑偄傑偡丅偙傟傪傗傔偝
偣傞偵偼丄師偺僐儅儞僪傪幚峴偟傑偡丅

  rdev -R /zImage 1                                                    

偙偺僐儅儞僪偱僇乕僱儖偑廋惓偝傟傞偺偱丄僼傽僀儖僔僗僥儉偼 "dirty" 偩偲
敾抐偝傟傞偙偲偑側偔側傝傑偡丅

    拲堄: lilo 傪巊偭偰偄傞応崌丄lilo 偺愝掕僼傽僀儖 (捠忢偼丄/etc/
    lilo.conf) 偺 linux 愝掕偺晹暘偵 read-only 傪壛偊偰偔偩偝偄丅
   
劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.11. 儕僽乕僩偺嵺丄"device busy" 偺偣偄偱 fsck 偝傟傞偺傪旔偗傞曽朄乣
Jon Tombs <jon@gtex02.us.es>

僔儍僢僩僟僂儞帪偵 "device busy" 僄儔乕偑昿敪偡傞応崌偼丄儕僽乕僩帪偵僼
傽僀儖僔僗僥儉偑 fsck 偝傟傑偡丅埲壓偵娙扨側廋惓曽朄傪弎傋傑偡丅

/etc/rc.d/init.d/halt 偐 /etc/rc.d/rc.0 偵堏摦偟丄偦偟偰

  mount -o remount,ro /mount.dir                                       

偺堦峴傪丄umout -a 傪屇傇慜偵丄/ 傪彍偄偨丄儅僂儞僩偡傞梊掕偺偡傋偰偺僼
傽僀儖僔僗僥儉偵懳偟偰晅偗壛偊傑偡丅偙偆偡傟偽丄壗傜偐偺棟桼偱 shutdown
偑僾儘僙僗偺 kill 偵幐攕偟偰僨傿僗僋偺 umount 偑偱偒側偐偭偨応崌偱傕丄
儕僽乕僩偺嵺丄僨傿僗僋偼 "clean" 側傑傑偱偡丅儕僽乕僩帪娫傪偐側傝愡栺偟
偰偔傟傑偡丅 

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.12. 僴乕僪僨傿僗僋忋偺堦斣戝偒側僼傽僀儖傪尒偮偗傞曽朄乣Simon Amor
<simon@foobar.co.uk>

  ls -l | sort +4n                                                     

偁傞偄偼丄僨傿僗僋僗儁乕僗偑傑偝偵昇敆偟偰偄傞応崌偵偼丄偪傚偭偲帪娫偑
妡偐傝傑偡偑丄岠壥偰偒傔傫偺師偺僐儅儞僪傪巊偭偰偔偩偝偄丅

  cd /                                                                 
  ls -lR | sort +4n                                                    

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.13. 僷儞僠寠傪奐偗傞儅乕僕儞傪庢偭偰僾儕儞僩傾僂僩偡傞曽朄乣Mike
Dickey <mdickey@thorplus.lib.purdue.edu>

  #!/bin/sh                                                            
  # /usr/local/bin/print                                               
  # a simple formatted printout, to enable someone to                  
  # 3-hole punch the output and put it in a binder                     
                                                                       
  cat $1 | pr -t -o 5 -w 85 | lpr                                      

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.14. 摿掕偺惓婯昞尰傪巊偭偰僼傽僀儖僣儕乕傪専嶕偡傞曽朄乣Raul Deluth
Miller <rockwell@nova.umd.edu>

傢偨偟偼偙偺僗僋儕僾僩傪 "forall" 偲屇傫偱偄傑偡丅師偺傛偆偵偟偰巊偭偰
偔偩偝偄丅

  forall /usr/include grep -i ioctl                                    
  forall /usr/man grep ioctl                                           

埲壓偼丄"forall" 偺拞恎偱偡丅

  #!/bin/sh                                                            
  if [ 1 = `expr 2 \> $#` ]                                            
  then                                                                 
          echo Usage: $0 dir cmd [optargs]                             
          exit 1                                                       
  fi                                                                   
  dir=$1                                                               
  shift                                                                
  find $dir -type f -print | xargs "$@"                                

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.15. 僾儘僌儔儉偑彑庤偵嶌偭偨僶僢僋傾僢僾僼傽僀儖傗僆乕僩僙乕僽僼傽僀
儖傪憒彍偡傞僗僋儕僾僩乣Barry Tolnas <tolnas@nestor.engr.utk.edu>

埲壓偱徯夘偡傞偺偼丄emacs 偺僆乕僩僙乕僽僼傽僀儖( #)丄僶僢僋傾僢僾僼傽
僀儖(~)丄 .o 僼傽僀儖丄TeX 偺 .log 僼傽僀儖偵偮偄偰丄僼傽僀儖奒憌傪嵞婣
揑偵壓崀偟偰嶍彍偡傞娙扨側 2 峴儌僲偱偡丅.tex 偲 README 僼傽僀儖偺埑弅
傕偟傑偡丅傢偨偟偼偙傟傪 "sqeeze" 偲屇傫偱偄傑偡丅

  #!/bin/sh                                                                                 
  #SQUEEZE removes unnecessary files and compresses .tex and README files                   
  #By Barry tolnas, tolnas@sun1.engr.utk.edu                                                
  #                                                                                         
  echo squeezing $PWD                                                                       
  find  $PWD \( -name \*~ -or -name \*.o -or -name \*.log -or -name \*\#\) -exec            
  rm -f {} \;                                                                               
  find $PWD \( -name \*.tex -or -name \*README\* -or -name \*readme\* \) -exec gzip -9 {} \;

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.16. 堦斣儊儌儕傪怘偭偰偄傞僾儘僙僗傪扵偡曽朄乣Simon Amor
<simon@foobar.co.uk >

  ps -aux | sort +4n                                                   

傑偨偼丄

  ps -aux | sort +5n                                                   

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.17. C 僾儘僌儔儈儞僌岦偗偵 vi 傪偄偠傞乣Paul Anderson Tips-HOWTO 娗棟
幰

傢偨偟偼丄壣偑偁傞偲 C 僾儘僌儔儉傪彂偄偰傑偡丅偦偺崌娫偵丄vi 偱 C 傪彂
偒傗偡偔偡傞偨傔偺廋惓傪壛偊傑偟偨丅埲壓偑傢偨偟偺 .exrc 偱偡丅

  set autoindent                                                       
  set shiftwidth=4                                                     
  set backspace=2                                                      
  set ruler                                                            

偙傟偑壗傪偟偰偄傞偐偲偄偆偲丄傑偢 autoindent 偼丄嵟弶偵堦搙僀儞僨儞僩
傪擖傟傞偲偦傟埲壓偺峴偱傕帺摦揑偵僀儞僨儞僩傪擖傟傞傕偺偱偡丅
shiftwidth 偼丄^T 傪僗儁乕僗 4 偮暘偵愝掕偡傞傕偺偱丄backspace 偼丄
backspace 儌乕僪偵愝掕偡傞傕偺丄ruler 偼丄峴斣崋傪昞帵偡傞傕偺偱偡丅摿
掕偺峴斣崋偵堏摦偡傞応崌丄偨偲偊偽 20 峴栚偵峴偔偵偼丄師偺僐儅儞僪傪巊
偄傑偡丅

  vi +20 myfile.c                                                      

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.18. ctags 傪巊偭偰丄僾儘僌儔儈儞僌傪傗傝傗偡偔偡傞曽朄

偨偄偰偄偺僴僢僇乕偼丄僐儞僺儏乕僞忋偵 ctags 傪擖傟偰偄傑偡偑丄巊偭偰傑
偣傫丅偱傕丄偙傟偼摿掕偺娭悢傪曇廤偡傞嵺偵偲偰傕曋棙偱偡丅偨偲偊偽丄偁
傞娭悢偑偁傝丄偦傟偑嶌惉拞偺僾儘僌儔儉梡僨傿儗僋僩儕撪偺偨偔偝傫偺僜乕
僗僼傽僀儖偺傂偲偮偵擖偭偰偄偰丄偪傚偆偳峏怴偺偨傔偵偦偺娭悢偺曇廤傪偟
偨偄偺偩偲偟傑偡丅偦偟偰丄偙偺娭悢偺柤慜偼丄foo() 偩偲偟偰丄偙傟傪偳偺
僜乕僗僼傽僀儖偵擖傟偨偺偐朰傟偰偟傑偭偨偲偟傑偡丅ctags 偑曋棙側偺偼偦
偆偄偆応崌偱偡丅ctags 傪幚峴偡傞偲丄tags 偲偄偆僼傽僀儖偑僇儗儞僩僨傿儗
僋僩儕偵嶌惉偝傟丄偦偺僼傽僀儖偵偡傋偰偺娭悢偑昞帵偝傟傑偡丅偦偟偰丄偦
傟傜偑偳偺僼傽僀儖偵偁傞偺偐丄偦偺僼傽僀儖撪偺偳偙偵偁傞偺偐傪嫵偊偰偔
傟傑偡丅tags 僼傽僀儖偺拞恎偼師偺傛偆側傕偺偱偡丅

   ActiveIconManager    iconmgr.c       /^void ActiveIconManager(active)$/                       
  AddDefaultBindings    add_window.c    /^AddDefaultBindings ()$/                                
  AddEndResize  resize.c        /^AddEndResize(tmp_win)$/                                        
  AddFuncButton menus.c /^Bool AddFuncButton (num, cont, mods, func, menu, item)$/               
  AddFuncKey    menus.c /^Bool AddFuncKey (name, cont, mods, func, menu, win_name, action)$/     
  AddIconManager        iconmgr.c       /^WList *AddIconManager(tmp_win)$/                       
  AddIconRegion icons.c /^AddIconRegion(geom, grav1, grav2, stepx, stepy)$/                      
  AddStartResize        resize.c        /^AddStartResize(tmp_win, x, y, w, h)$/                  
  AddToClientsList      workmgr.c       /^void AddToClientsList (workspace, client)$/            
  AddToList     list.c  /^AddToList(list_head, name, ptr)$/                                      

vim 偱丄偨偲偊偽 AddEndResize() 傪曇廤偡傞応崌偼丄師偺傛偆偵偟傑偡丅

  vim -t AddEndResize                                                  

偙傟偵傛偭偰丄僄僨傿僞偵揔愗側僼傽僀儖偑撉傒崬傑傟丄僇乕僜儖埵抲偑巜掕
偟偨娭悢偺嵟弶偵偒傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.19. Red Hat 偱 sendmail 偑婲摦帪偵 5 暘娫僴儞僌偡傞棟桼乣Paul
Anderson <paul@geeky1.ebtech.net>

偙傟偼丄FAQ 偺懳徾偵側傞偔傜偄峀偔抦傜傟偨栤戣偱偡丅Red Hat 偺僨傿僗僩
儕價儏乕僔儑儞偱偙偺僶僌偑廋惓偝傟偨偺偐偳偆偐偼抦傝傑偣傫偑丄帺暘偱捈
偡偙偲傕偱偒傑偡丅/etc/hosts 僼傽僀儖傪擿偔偲丄師偺傛偆偵側偭偰偄傞偺偑
暘偐傞偲巚偄傑偡丅

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆  127.0.0.1             localhost       yourbox                     劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

sendmail 偼婲摦帪偵儂僗僩柤(忋婰偺椺偱偼丄 yourbox) 傪扵偟傑偡丅偦偟偰
丄yourbox 偺 IP 偑 127.0.0.1 偱偁傞偙偲傪抦傞傢偗偱偡偑丄sendmail 偼偙
偺 IP 偑寵偄側偺偱丄傕偆堦搙丄扵偦偆偲偟傑偡丅偙傟傪壗搙偐孞傝曉偟偰丄
嵟屻偵掹傔偰廔椆偟偰偟傑偄傑偡丅偙偺栤戣傪夝寛偡傞偺偼偲偰傕娙扨偱丄/
etc/hosts 僼傽僀儖傪奐偄偰丄偨偲偊偽師偺傛偆偵曄峏偡傞偩偗偱偡丅

劇劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劉
劆  127.0.0.1             localhost                                   劆
劆  10.56.142.1           yourbox                                     劆
劋劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劊

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.20. Red Hat 偱 color-ls 傪巊偆偨傔偺愝掕曽朄乣Paul Anderson
<paul@geeky1.ebtech.net>

Red Hat 僨傿僗僩儕價儏乕僔儑儞偵偼 color-ls 偑摨崼偝傟偰偄傑偡偑丄偳偆
偟偰弶婜愝掕偺怓巊偄偺傑傑曻抲偝傟偰偄傞偺偐棟夝偵嬯偟傒傑偡丅埲壓偼丄
偦傟傪廋惓偡傞傕偺偱偡丅

傑偢丄eval `DIRCOLORS` 偲僞僀僾偟傑偡丅

師偵丄alias ls='ls --color=auto' 偲偟傑偡丅

偦偟偰丄忋婰 alias..... 傪 /etc/bashrc 偵婰弎偟傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.21. 摿掕偺娭悢偑 /usr/lib 偺偳偺儔僀僽儔儕偵偁傞偐扵偡曽朄乣Pawel
Veselow <vps@unicorn.niimm.spb.su>

僐儞僷僀儖偺搑拞偱儕儞僋偡傞昁梫偑偁傞儔僀僽儔儕偑尒摉偨傜側偄応崌丄偳
偆偟傑偡丠 gcc 偑曬崘偡傞偺偼娭悢柤偩偗偱偡丅埲壓偺娙扨側僐儅儞僪偱丄偦
偺娭悢傪尒偮偗傞偙偲偑偱偒傑偡丅

  for i in *; do echo $i:;nm $i|grep tgetnum 2>/dev/null;done          

忋婰偺 tgetnum 偲偄偆晹暘偵丄扵偟偰偄傞娭悢柤偑偼偄傝傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

2.22. C 偺娙扨側 test 僾儘僌儔儉傪僐儞僷僀儖偟偨偗傟偳丄幚峴偟偰傕壗傕
弌椡偝傟側偄両

偍偦傜偔丄偦偺僾儘僌儔儉傪僐儞僷僀儖偟偰丄test 偲偄偆柤慜偺僶僀僫儕傪嶌
惉偟偨偺偱偼側偄偱偟傚偆偐丠 Linux 偵偼 test 偲偄偆僾儘僌儔儉偑傕偲傕偲
懚嵼偟偰偄傑偡丅偙傟偼丄偁傞忦審偑恀偐斲偐傪僥僗僩偡傞僾儘僌儔儉偱丄恀
偺応崌偼夋柺偵壗傕昞帵偟傑偣傫丅扨偵 test 偲懪偮偺偱偼側偔丄./test 偲懪
偭偰傒偰偔偩偝偄丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3. 徻偟偄 Tips

3.1. Linux 偲 Windows 偱僗儚僢僾僷乕僥傿僔儑儞傪嫟桳偡傞曽朄乣Tony
Acero <ace3@midway.uchicago.edu>

 

 1. 傑偢丄懳徾偲側傞僷乕僥傿僔儑儞傪 DOS 僷乕僥傿僔儑儞偲偟偰僼僅乕儅僢
    僩偟偰丄偦偺僷乕僥傿僔儑儞忋偵 Windows 僗儚僢僾僼傽僀儖傪嶌惉偟傑偡
    丅偟偐偟丄傑偩 Windows 偼婲摦偟側偄偱偔偩偝偄(偁偲偱埑弅偑傛偔岠偔
    傛偆偵丄偙偺帪揰偱偼僗儚僢僾僼傽僀儖傪嬻偵偟偰偍偄偰偔偩偝偄)丅
   
 2. Linux 傪婲摦偟偰丄忋婰僷乕僥傿僔儑儞傪僼傽僀儖偲偟偰曐懚偟傑偡丅偨
    偲偊偽丄僷乕僥傿僔儑儞偑 /dev/hda8 偱偁傞偲偡傞偲丄埲壓偺傛偆偵偟傑
    偡丅
   
      dd if=/dev/hda8 of=/etc/dosswap                           
   
 3. DOS 僗儚僢僾僼傽僀儖傪埑弅偟傑偡丅傎傏偡傋偰 0 偑暲傫偱偄傞偺偱丄埑
    弅偼旕忢偵傛偔岠偒傑偡丅
   
      gzip -9 /etc/dosswap                                      
   
 4. /etc/rc 僼傽僀儖偵師偺傛偆側峴傪壛偊偰丄Linux 忋偵僗儚僢僾僗儁乕僗
    傪弨旛偟丄僀儞僗僩乕儖偟傑偡丅
   
        拲堄: XXXXX 偺晹暘偵偼丄僗儚僢僾僷乕僥傿僔儑儞偺僽儘僢僋悢偑擖
        傝傑偡丅
       
      mkswap /dev/hda8 XXXXX                                    
      swapon -av                                                
   
    /etc/fstab 僼傽僀儖偵偙偺僗儚僢僾僷乕僥傿僔儑儞偺僄儞僩儕傪壛偊傞偺
    傪朰傟側偄偱偔偩偝偄丅
   
 5. 偍巊偄偺 init 偍傛傃 reboot 僷僢働乕僕偑 /etc/brc 偐 /sbin/brc 傪僒
    億乕僩偟偰偄傞応崌丄師偺峴傪 /etc/brc 偵晅偗壛偊偰偔偩偝偄丅僒億乕
    僩偟偰偄側偄帪偼丄DOS 傕偟偔偼 OS/2 傪僽乕僩偡傞応崌偱僗儚僢僾僷乕
    僥傿僔儑儞傪 DOS/Windows 僶乕僕儑儞偵栠偟偨偄応崌偵丄壓婰傪庤摦偱擖
    椡偟偰偔偩偝偄丅
   
      swapoff -av                                               
      zcat /etc/dosswap.gz | dd of=/dev/hda8 bs=1k count=100    
   
        拲堄: 忋婰偼丄嵟弶偺 100 僽儘僢僋傪僷乕僥傿僔儑儞忋偵彂偒栠偡偩
        偗偱偡丅傢偨偟偼丄宱尡忋偙傟偱廩暘偩偲巚偭偰偄傑偡丅
       
>> 偙偺曽朄偺挿強偲抁強

挿強丗偐側傝偺僨傿僗僋僗儁乕僗傪愡栺偱偒傞偙偲丅

抁強丗僗僥僢僾 5 傪帺摦壔偱偒側偄応崌丄枅夞庤摦偱擖椡偟側偗傟偽側傜側偄
偺偱丄儕僽乕僩偑 1 僫僲昩抶傟偰偟傑偆偙偲丅:-)

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.2. 嶍彍偟偰偟傑偭偨僼傽僀儖傪側傫偲偐暅妶偝偣傞曽朄乣Michael Hamilton
<michael@actrix.gen.nz>

偙偙偱偼丄傢偨偟偑偙傟傑偱壗搙偐巊偭偨僩儕僢僋傪徯夘偟傑偡丅

嶍彍偟偰偟傑偭偨僥僉僗僩僼傽僀儖傪側傫偲偐偟偰暅妶偝偣傞曽朄丅

僥僉僗僩僼傽僀儖丄偨偲偊偽儊乕儖傗怺栭偺僾儘僌儔儈儞僌嶌嬈偺惉壥偲偄偭
偨傕偺傪岆偭偰嶍彍偟偰偟傑偭偨偲偟偰傕丄掹傔偰偟傑偆偺偼憗寁偱偡丅僼傽
僀儖偑堦扷僨傿僗僋偵彂偒崬傑傟偰偄偨応崌丄偡側傢偪丄偩偄偨偄 30 昩埲忋
偦偙偵偁偭偨応崌偼丄偦偺撪梕偼傑偩僨傿僗僋僷乕僥傿僔儑儞偵巆偭偰偄傞偐
傕偟傟傑偣傫丅

grep 僐儅儞僪傪巊偭偰丄惗偺僨傿僗僋僷乕僥傿僔儑儞 (raw disk partition)
傪専嶕偟丄僼傽僀儖偺拞恎傪扵偡偙偲偑偱偒傑偡丅

偨偲偊偽丄嵟嬤傢偨偟偼岆偭偰偁傞儊乕儖傪嶍彍偟偰偟傑偄傑偟偨丅偦偺嵺丄
傑偢傢偨偟偼儊乕儖偑懚嵼偟偰偄偨僷乕僥傿僔儑儞偺撪梕傪曄峏偟偰偟傑偆傛
偆側嶌嬈傪偡傋偰媫绡庢傝傗傔傑偟偨丅偙偺帪偼丄僼傽僀儖傪曐懚偟偨傝丄僾
儘僌儔儉傪僐儞僷僀儖偟偨傝偟側偄傛偆偵偟傑偟偨丅偦傟埲奜偵傕丄幚嵺偵僔
僗僥儉傪僔儞僌儖儐乕僓儌乕僪偵棊偲偟偰丄偦偺僼傽僀儖僔僗僥儉傪 umount
偟偨偙偲傕偁傝傑偟偨丅

師偵丄傢偨偟偼丄懳徾偲側傞僨傿僗僋僷乕僥傿僔儑儞偵 egrep 僐儅儞僪傪偐偗
傑偟偨丅偦偺嵺丄嶍彍偟偰偟傑偭偨儊乕儖偼 /usr/local/home/michael/ 偵抲
偐傟偰偄偨偺偱丄 df 僐儅儞僪偺弌椡偐傜丄偦傟偑 /dev/hdb5 偵偁傞偙偲偑暘
偐傝傑偟偨丅

  sputnik3:~ % df                                                      
    Filesystem         1024-blocks  Used Available Capacity Mounted on 
    /dev/hda3              18621    9759     7901     55%   /          
    /dev/hdb3             308852  258443    34458     88%   /usr       
    /dev/hdb5             466896  407062    35720     92%   /usr/local 
                                                                       
  sputnik3:~ % su                                                      
  Password:                                                            
  [michael@sputnik3 michael]# egrep -50 'ftp.+COL' /dev/hdb5 > /tmp/x  
                                                                       

傢偨偟偼丄僨傿僗僋僷乕僥傿僔儑儞傪偄偠傞嵺偼嬌抂偵怲廳偵側傞偺偱丄偙偙
偱傕儕僞乕儞僉乕傪墴偡慜偵丄堦扷娫傪偍偄偰丄僐儅儞僪偺峔暥偑惓妋偐偳偆
偐妋擣偟傑偟偨丅偙偺応崌丄儊乕儖偵偼 "ftp" 偲偄偆扨岅偑娷傑傟偰偄偰丄偦
偺屻偵 "COL" 偲偄偆扨岅偱巒傑傞暥復偑懕偄偰偄傑偟偨丅儊乕儖偺儊僢僙乕僕
偼 20 峴偔傜偄偩偭偨偺偱丄-50 傪巊偭偰奩摉偡傞暥復偺慜屻偡傋偰偺僥僉僗
僩傪庢摼偡傞傛偆偵偟傑偟偨丅埲慜偼丄-3000 傪巊偭偰丄僜乕僗僐乕僪偺偡傋
偰偺峴傪庢摼偱偒傞傛偆偵偟偨偙偲傕偁傝偡丅傑偨丄偙偙偱偼丄egrep 偺弌椡
傪暿偺僨傿僗僋僷乕僥傿僔儑儞偵儕僟僀儗僋僩偟偰偄傑偡丅偙傟偼丄扵偟偰偄
傞儊乕儖偑丄egrep 偺弌椡偱忋彂偒偝傟偰偟傑偆偙偲傪杊巭偡傞偨傔偱偡丅

偮偯偄偰丄strings 傪巊偭偰丄庢摼偟偨弌椡傪専嵏偟偰傒傑偟偨丅

  strings /tmp/x | less                                                

巚偭偨捠傝丄儊乕儖偼偦偺拞偵擖偭偰偄傑偟偨丅

偙偺曽朄偼丄僨傿僗僋僗儁乕僗偺慡晹傑偨偼堦晹偑偡偱偵忋彂偒偝傟偰偄傞傛
偆側応崌偵偼丄惉岟偟側偄偐傕偟傟傑偣傫丅

偙偺僩儕僢僋偑桳岠側偺偼丄偍偦傜偔堦恖偱僔僗僥儉傪巊偭偰偄傞応崌偩偗偐
傕偟傟傑偣傫丅暋悢偺儐乕僓偑偄偰丄僨傿僗僋偑昿斏偵彂偒姺偊傜傟傞応崌偩
偲丄嶍彍偟偨僼傽僀儖偑抲偐傟偰偄偨嬻娫偼偡偱偵忋彂偒偝傟偰偟傑偭偰偄傞
偐傕偟傟傑偣傫丅偦傟偵丄偨偄偰偺儐乕僓偼丄僼傽僀儖傪暅媽偡傞昁梫偑偁傞
偲偒偱傕丄儅僔儞傪彑庤偵撈傝愯傔偡傞傛偆側偙偲偼偱偒傑偣傫丅

傢偨偟偺帺戭偺僔僗僥儉偱偼丄夁嫀悢擭偱 3 搙傎偳丄悢擔暘偺惉壥傪娫堘偭偰
幪偰偰偟傑偭偨嵺偵丄偙偺僩儕僢僋偑栶棫偪傑偟偨丅偙偆偟偨嶌嬈傪捠偠偰帺
暘偱傕偨偄傊傫恑曕偟偨偲巚偭偰偄傞揰偼丄僼儘僢僺乕偵嶌嬈偺僶僢僋傾僢僾
傪庢偭偰偍偔傛偆偵側偭偨偙偲偱偡丅偍偐偘偱丄偙偺僩儕僢僋傪巊偆婡夛偼悘
暘尭傝傑偟偨丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.3. immutable(晄曄)僼儔僌偺巊偄曽乣Jim Dennis <jadestar@rahul.net>

Immutable 僼儔僌傪巊偍偆丅

僔僗僥儉偺僀儞僗僩乕儖偲愝掕偑嵪傫偩傜丄偡偖偵 /bin丄 /sbin丄/usr/bin丄
/usr/sbin丄/usr/lib (偦偺懠丄偍傛偦昁梫偦偆側応強) 偵偄偭偰丄偳傫偳傫 
chattr +i 僐儅儞僪傪幚峴偟傑偡丅偦偟偰丄root 偵側偭偰丄僇乕僱儖僼傽僀儖
偵傕偦偺僐儅儞僪傪幚峴偟偰偔偩偝偄丅師偵丄mkdir /etc/.dist/ 傪幚峴偟偰
丄/etc 埲壓偵偁傞慡僼傽僀儖傪偦偺僨傿儗僋僩儕偵僐僺乕偟傑偡 (傢偨偟偼丄
堦扷 /tmp/etcdist.tar 傪嶌傞偙偲偱丄僐僺乕偑儖乕僾偡傞偺傪杊偄偱偄傑偡
丅/etc/.dist.tar.gz 傪嶌傞偲偄偆偺偱傕偄偄偱偟傚偆)丅偦偟偰丄偦傟傜偺僼
傽僀儖傕 immutable 偵偟傑偡丅

偙偺傛偆偵偟偰偍偔偲丄root 偱儘僌僀儞偟偨嵺偱傕婲偙傝偆傞僟儊乕僕傪嵟彫
尷偵怘偄巭傔傜傟傑偡丅儕僟僀儗僋僔儑儞憖嶌傪岆偭偰僼傽僀儖傪忋彂偒偡傞
偙偲偑側偔側傝傑偡偟丄rm -fr 僐儅儞僪偱娫堘偭偰僗儁乕僗傪擖傟偰偟傑偄僔
僗僥儉傪晄埨掕偵偟偰偟傑偆偙偲傕側偔側傝傑偡(偦偺応崌偱傕丄僨乕僞偵偼偐
側傝偺僟儊乕僕偑媦傇偐傕偟傟傑偣傫偑丄儔僀僽儔儕偲僶僀僫儕偺埨慡惈偼岦
忋偟傑偡)丅

傑偨丄偙偺嶌嬈偵傛傝僙僉儏儕僥傿慡斒偑嫮壔偝傟丄僒乕價僗傪掆巭偝偣傞傛
偆側峌寕偑晄壜擻傕偟偔偼傛傝崲擄偵側傝傑偡(偦偆偟偨峌寕偺懡偔偼丄SUID
偝傟偨僾儘僌儔儉偺嫇摦傪埆梡偟偰僼傽僀儖傪忋彂偒偡傞曽朄傪偲偭偰偄傑偡
偑丄偦偆偟偨 SUID 偝傟偨僾儘僌儔儉偼杮棃彑庤側僔僃儖僐儅儞僪偺幚峴傪嫋
偡傕偺偱偼側偄偐傜偱偡)丅

偙偺嶌嬈偵傛傞桞堦偺抁強偼丄條乆側僔僗僥儉僐儅儞僪傪價儖僪偟偰丄 make
install 偡傞嵺偵晄曋偑惗偠傞偲偄偆揰偱偡丅偮傑傝丄make install 偡傞応崌
偱傕丄僼傽僀儖傪忋彂偒偱偒側偔側偭偰偟傑偄傑偡丅偁傜偐偠傔 Makefile 傪
撉傫偱丄忋彂偒偝傟傞偙偲偵側傞僼傽僀儖(偍傛傃僼傽僀儖偑僀儞僗僩乕儖偝傟
傞僨傿儗僋僩儕) 偵懳偟偰 chattr -i 傪幚峴偡傞偺傪朰傟傞偲丄make 偑幐攕
偟偰偟傑偄傑偡丅偦偆偟偨応崌偼丄chattr 傪幚峴偟丄嵞搙 make 偟偰偔偩偝偄
丅傑偨丄偦偺婡夛傪棙梡偟偰丄屆偄僶僀僫儕傗儔僀僽儔儕側偳傪 .old/ 僨傿儗
僋僩儕偵堏摦偝偣偨傝丄儕僱乕儉偟偨傝丄 tar 偱傑偲傔偰偍偄偨傝偡傞偲偄偄
偐傕偟傟傑偣傫丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.4. 怴偟偄儌僲傪擖傟傞応強偵偮偄偰偺採尵乣Jim Dennis
<jadestr@rahul.net>

怴偟偄儌僲偼傒傫側 /usr/local 偐 /usr/local/'hostname' 偐傜巒傔傛偆丅

偍巊偄偺僨傿僗僩儕價儏乕僔儑儞偺 /usr/local 埲壓偑嬻偵側偭偰偄傞側傜丄
帺暘偱 /usr/local/src 傗 /usr/local/bin 側偳傪嶌惉偟偰巊偄傑偟傚偆丅偍
巊偄偺僨傿僗僩儕價儏乕僔儑儞偺 /usr/local 埲壓偵偡偱偵僼傽僀儖僣儕乕偑
偁傞応崌偼丄mkdir /usr/local/'hostname' 傪幚峴偟偨忋偱丄'wheel' 僌儖乕
僾偵彂偒崬傒尃尷(+w) 傪梌偊傑偟傚偆(傢偨偟偼偝傜偵丄SUID 偍傛傃 SGID 偡
傞偙偲偱丄wheel 僌儖乕僾偺屄乆偺儊儞僶偩偗偑偦偙偵僼傽僀儖傪抲偗丄偦傟
傜偺慡僼傽僀儖偑 wheel 僌儖乕僾偵懏偡傞傛偆偵偟偰偄傑偡)丅

偙傟偐傜偼丄偄偮傕両偄偮傕両偄偮傕両怴偟偄僷僢働乕僕傪 /usr/local/src
/.from/庢摼応強偺柤慜($WHERE_I_GOT_IT)/ 偵抲偄偰丄/usr/local/src (傕偟
偔偼 ... /$HOSTNAME/src) 埲壓偱僐儞僷僀儖偡傞傛偆偵偟傑偟傚偆丅傕偟乽偳
偆偟偰傕乿/bin 傗 /usr/bin 摍偵僀儞僗僩乕儖偟側偗傟偽側傜側偄僾儘僌儔儉
偱偁傞側傜丄/usr/local/ 埲壓偺奒憌偐傜昁梫側応強偵僔儞儃儕僢僋儕儞僋傪
挘傞傛偆偵偟傑偟傚偆丅

偙偆偟偨嶌嬈偼柺搢偱偼偁傝傑偡偑丄偙傟偵傛偭偰丄僨傿僗僩儕價儏乕僔儑儞
偺儊僨傿傾(嵟嬤偼 CD 偑堦斒揑偱偡)偐傜慡懱傪嵞僀儞僗僩乕儖偡傞嵺偵丄僶
僢僋傾僢僾傗儕僗僩傾偡傋偒晹暘偲丄嵞僀儞僗僩乕儖偡傋偒晹暘傪暘偗傗偡偔
側傝傑偡丅傑偨丄/usr/local/.from 僨傿儗僋僩儕傪巊偆偙偲偱丄僜乕僗傪偳偙
偐傜庢偭偰偒偨偐傪晄姰慡側偑傜婰榐偟偰偍偔偙偲偑偱偒傞偺偱丄僷僢働乕僕
傪峏怴偡傞偲偒偵曋棙偱偡偟丄僙僉儏儕僥傿娭學偺傾僫僂儞僗傪捛偄偐偗傞偲
偒偵偼旕忢偵廳梫側忣曬偵側傝傑偡丅

帺戭偺僔僗僥儉偺傂偲偮(崱偙傟傪彂偄偰偄傞儅僔儞)傪巊偄巒傔偨摉帪丄傢偨
偟偼傑偩偙偆偟偨曽恓傪幚峴偟偰偄傑偣傫偱偟偨丅偦傟備偊丄乽僀儞僗僩乕儖
偟偨摉弶偺乿忬懺偲尰嵼偺忬懺偲偑偳傟偩偗堘偆偐枹偩偵傛偔暘偐偭偰偄傑偣
傫丅儅僔儞偺僔僗僥儉愝掕偼傎偲傫偳偄偠偭偰偍傜偢丄偙傟傪巊偭偰偄傞偺偼
帺暘偩偗偱偁傞偵傕娭傢傜偢丄偦傫側忬嫷側偺偱偡丅

偦傟偵傂偒偐偊丄傢偨偟偑怑応(僔僗僥儉娗棟幰偺栶傪傗傜偝傟偰偄偨崰偱偡)
偱愝抲偟偨僔僗僥儉偼丄偡傋偰忋婰偺曽朄偱愝掕偟傑偟偨丅偦傟傜偺儅僔儞偼
丄宊栺愭偺 SE 傗忣曬娭學偺條乆側傂偲傃偲偵傛偭偰娗棟偝傟偰偒傑偟偨偑丄
崱偱傕傢偨偟偼丄嵟弶偵僀儞僗僩乕儖偲愝掕傪偟偨屻偵慻傒擖傟傜傟偨僷僢働
乕僕偑偳傟側偺偐傪偮傇偝偵棟夝偟偰偄傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.5. 僨傿儗僋僩儕撪偺僼傽僀儖柤傪彫暥帤偵曄姺偡傞乣Justin Dossey
<dossey@ou.edu>

Linux Gazette 偺 issue 12 偵宖嵹偝傟偰偄傞 2c tips (栿拲丗尨暥偼丄偙偪
傜 <http://www.linuxgazette.com/issue12/lg_tips12.html#lowerit>偱偡丅側
偍丄偙偺 Tips 偼丄Linux Gazette issue 13 <http://www.linuxgazette.com/
issue13/lg_tips13.html#notes> 偵宖嵹偝傟偰偄傑偡丅嶳岥偝傫丄忣曬採嫙偁
傝偑偲偆偛偞偄傑偟偨丅) 偱丄偪傚偭偲擄偟偡偓傞偐晄昁梫偲巚傢傟傞庤弴偑
徯夘偝傟偰偄傞偙偲偵婥晅偒傑偟偨丅曽朄偼偄傠偄傠偁傞傢偗側偺偱丄傢偨偟
偐傜傕偦偺庤弴傪徯夘偟傑偡丅

  #!/bin/sh                                                               
         # lowerit                                                        
         # 僇儗儞僩僨傿儗僋僩儕偺慡僼傽僀儖柤傪彫暥帤偵曄姺偡傞僗僋儕僾僩 
         # 捠忢僼傽僀儖偩偗傪懳徾偲偡傞 --僨傿儗僋僩儕柤偼曄峏偟側偄      
         # 婛懚偺僼傽僀儖傪忋彂偒偡傞慜偵丄妋擣傪媮傔傞                   
         for x in `ls`                                                    
           do                                                             
           if [ ! -f $x ]; then                                           
             continue                                                     
             fi                                                           
           lc=`echo $x  | tr '[A-Z]' '[a-z]'`                             
           if [ $lc != $x ]; then                                         
             mv -i $x $lc                                                 
           fi                                                             
           done                                                           

傫乣丄挿偡偓傑偡丅傢偨偟側傜丄偙偆偄偆傆偆偵偼彂偒傑偣傫丅傓偟傠丄師偺
僐儅儞僪傪巊偄傑偡丅

  for i in * ; do [ -f $i ] && mv -i $i `echo $i | tr '[A-Z]' '[a-z]'`;
  done;                                                                

偙傟側傜丄僐儅儞僪儔僀儞偱弌棃傑偡丅

偙偺搳峞幰偼丄斵偑巊偭偰偄傞曽朄傪暘偐傝堈偄僗僋儕僾僩偵偟偨偲偄偭偰偄
傑偡偑(壓婰嶲徠)丄偪傚偭偲堘偆偲巚偆丅

師偺 tips 偼丄儐乕僓偺捛壛偲嶍彍偵偮偄偰偱偡丅Geoff 偼忋庤偔傗偭偰偄傑
偡偑丄嵟屻偺庤弴偑傛偔側偄丅儕僽乕僩丠斵偑儐乕僓偺嶍彍偺偨傃偵儕僽乕僩
偟偰偄側偄偙偲傪朷傒傑偡丅嵟弶偺傆偨偮偺庤弴偱廩暘偱偡丅偦偺儐乕僓偑偳
傫側僾儘僙僗傪憱傜偣偰偄傞偺偱偟傚偆偐丠 IRC 儘儃僢僩偱偟傚偆偐丠偦偆偟
偨僾儘僙僗偼師偺僐儅儞僪偱娙扨偵 kill 偱偒傑偡丅

  kill -9 `ps -aux |grep ^ |tr -s " " |cut -d " " -f2`                 

偨偲偊偽丄儐乕僓柤偑 foo 側傜丄埲壓偺傛偆偵側傝傑偡丅

  kill -9 `ps -aux |grep ^foo |tr -s " " |cut -d " " -f2`              

偙傟偱廩暘偱偡丅朰傟偰偨 root 僷僗儚乕僪偑昁梫偵側傝傑偡偑丅

Linux Gazette 偱徯夘偝傟偰傞夝寛朄偼嵟傕斈梡惈偑偁傝傑偡偑丄堦斣娙扨側
曽朄偲偄偆傢偗偠傖偁傝傑偣傫丅LILO 傗 loadlin 傪巊偭偰偄傞側傜丄僽乕僩
僷儔儊僞偲偟偰 "single" 傪擖椡偟偰丄儘僌僀儞庤懕偒傗僷僗儚乕僪側偟偱僨
僼僅儖僩僔僃儖傪捈愙婲摦偱偒傑偡丅偦偺忬懺偱僷僗儚乕僪傪曄峏偡傞偐嶍彍
偟偨忋偱丄"init" 傪擖椡偟丄儅儖僠儐乕僓儌乕僪偵堏峴偡傟偽偄偄偲巚偄傑偡
丅偙偺応崌丄儕僽乕僩夞悢偼 1 夞偱嵪傒傑偡丅偦偆偱側偄偲 2 夞昁梫偱偡丅

Justin Dossey

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.6. Sendmail 傪傾僢僾僌儗乕僪偡傞曽朄乣Paul Anderson
<paul@geeky1.ebtech.net >

偙偙偱偼丄壗傕廋惓偝傟偰偄側偄僆儕僕僫儖偺僜乕僗傪巊偄傑偡丅傑偢丄
sendmail 偺僜乕僗僐乕僪傪擖庤偟傑偡丅傢偨偟偼丄version 8.9.0 傪庢偭偰偒
傑偟偨丅偙傟偼丄偍婥偯偒偐偲巚偄傑偡偑丄埨掕斉偱偼偁傝傑偣傫丅庢摼愭偼
丄 ftp.sendmail.org:/pub/sendmail/sendmail.8.9.0.tar.gz <ftp://
ftp.sendmail.org:/pub/sendmail/sendmail.8.9.0.tar.gz> 偱偟偨丅

偙傟偼 1 儊僈慜屻偁傝丄尰嵼傢偨偟偼 8.7.6 傪巊偭偰偄傞偙偲傪峫椂偡傞偲
丄偙偺嶌嬈偼側偐側偐戝曄偱偡丅忋庤偔偄偗偽儊乕儖偺傗傝偲傝偑偱偒傑偡偑
丄偦偆偱側偄偲丄儊乕儖側偟偱偼 HOWTO 偺怴斉傪弌偣側偔側偭偰偟傑偄傑偡
丅:)

僜乕僗傪棊偲偟偨傜丄夝搥偟傑偡丅夝搥偡傞偲丄僇儗儞僩僨傿儗僋僩儕偵
sendmail-8.9.0 偲偄偆僒僽僨傿儗僋僩儕偑嶌惉偝傟傑偡丅偦偺僨傿儗僋僩儕偵
堏摦偟偰丄README 偲 README_NOTES 傪撉傒傑偟傚偆(偦偟偰丄奐敪幰偨偪偑払
惉偟偨峏怴寢壥偵嬃湵偟傑偟傚偆)丅師偵丄src 僨傿儗僋僩儕偵堏摦偟傑偡丅嶌
嬈偺傎偲傫偳偼丄偙偙偱峴偄傑偡丅

    娙扨側拲堄: sendmail 偼丄僐儞僷僋僩偱僷儚僼儖側旕忢偵椙偔偱偒偨僾儘
    僌儔儉偱偡丅 sendmail 偺僶僀僫儕偼丄5x86 133MHx 偺 CPU 偲 32M 僶僀
    僩 RAM 偺傢偨偟偺娐嫬偱傕 5 暘埲壓偱僐儞僷僀儖偱偒傑偟偨丅(愝掕傪彍
    偄偨)僐儞僷僀儖偲僀儞僗僩乕儖慡懱偱丄15 暘埲壓偱偡両
   
傢偨偟偼晛抜帺暘偺僔僗僥儉忋偱 BIND 傪摦偐偟偰偄側偄偺偱丄師偺峴偼丄

  # ifndef NAMED_BIND                                                       
  #  define NAMED_BIND    1       /* use Berkeley Internet Domain Server */ 
  # endif                                                                   

1 傪 0 偵曄峏偟丄埲壓偺傛偆偵偟傑偟偨丅

  # ifndef NAMED_BIND                                                       
  #  define NAMED_BIND    0       /* use Berkeley Internet Domain Server */ 
  # endif                                                                   

Debian 1.3.1 偺応崌丄僨僼僅儖僩偱 db.h 偼丄sendmail 偱昁梫偲偝傟傞 /usr
/include 偱偼側偔丄/usr/include/db 偵僀儞僗僩乕儖偝傟傑偡丅偦傟備偊丄
src丄mailstats丄 makemap丄 praliases丄 rmail丄 smrsh 偺偦傟偧傟偺僨傿儗
僋僩儕偵堏摦偟偰丄師偺僐儅儞僪傪幚峴偟偰偔偩偝偄丅

 ./Build -I/usr/include/db                                             

埲忋偑嵪傫偩傜丄cd .. 傪幚峴偟丄make install 偲懪偭偰偔偩偝偄丅偙傟偱
sendmail version 8.9.0 偑僀儞僗僩乕儖偝傟傑偡両傕偪傠傫偙傟偼丄帺暘梡偺
愝掕僼傽僀儖傪婛偵傕偭偰偄傞応崌偱偡丅傢偨偟偼 majordomo 傪巊偭偨僼儕乕
儊乕儕儞僌儕僗僩傪儂僗僩偟偰偄傞偺偱丄偡傋偰傪僗儉乕僗偵壱摥偝偣傞偨傔
偵丄師偺峴傪 /etc/sendmail.cf 偵晅偗壛偊傞昁梫偑偁傝傑偟偨丅

  O DontBlameSendmail=forwardfileinunsafedirpath, forwardfileinunsafedirpathsafe

sendmail 8.9.0 偼丄僨傿儗僋僩儕攝抲傗僼傽僀儖僷乕儈僢僔儑儞偺愝掕傪嵟嬤
嵶偐偔僠僃僢僋偡傞傛偆偵側偭偰偄傞偺偱丄僄僀儕傾僗偲側偭偰偄傞僨傿儗僋
僩儕傗僼傽僀儖丄傕偟偔偼僌儖乕僾偱偺彂偒崬傒尃尷傗帺桼側彂偒崬傒尃尷偑
晅偗傜傟偨 .forward 僼傽僀儖偵偮偄偰 sendmail 偐傜暥嬪偑弌傞偐傕偟傟傑
偣傫丅偙偆偟偨嵶偐側僠僃僢僋婡擻傪掆巭偝偣傞偙偲偼傛偄峫偊偱偼偁傝傑偣
傫偑丄傢偨偟偼僔儞僌儖儐乕僓偱僐儞僜乕儖傪巊偭偰嶌嬈偡傞偩偗側偺偱丄僠
僃僢僋婡擻掆巭偑彫偝側僙僉儏儕僥傿儂乕儖偲側偭偨偲偟偰傕戝忎晇偩傠偆偲
巚偭偰偄傑偡丅偦偺偁偨傝偼丄偛帺暘偺娐嫬偵偁傢偣偰敾抐偟偰偔偩偝偄丅
YMMV

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.7. 怴恖僔僗僥儉娗棟幰偺偨傔偺 tips 乣Jim Dennis <jadestar@rahul.net>

/README.'hostname' 偐 /etc/README.'hostname' 偺偳偪傜偐堦曽傕偟偔偼椉曽
傪嶌偭偰丄偦傟傪娗棟偡傞偙偲 [ 偁傞偄偼丄/usr/local/etc/
README.'hostname' 偱傕偄偄偱偟傚偆乣娗棟恖]

僔僗僥儉娗棟傪巒傔偨偦偺擔偐傜丄昁偢僆儞儔僀儞偺儘僌僼傽僀儖偵婰榐傪晅
偗傞傛偆偵偟傑偟傚偆丅root 偺 /bash_logout 偵 "vi /README.$(hostname)"
偲偄偆堦峴傪擖傟偰偍偔偙偲傕偱偒傑偡丅偁傞偄偼丄師偺傛偆側 su 傕偟偔偼 
sudo 僗僋儕僾僩傪彂偄偰偍偄偰傕傛偄偱偟傚偆丅

  function exit \                                                      
          { unset exit; exit; \                                        
            cat ~/tmp/session.$(date +%y%m%d) \                        
            >> /README.$(hostname) && \                                
            vi /README.$(hostname)                                     
            }                                                          
  script -a ~/tmp/session.$(date +%y%m%d)                              
  /bin/su.org -                                                        

(擖椡棜楌傪婰榐偡傞僐儅儞僪傪巊偭偰僙僢僔儑儞儘僌傪庢傞偲偲傕偵丄娭悢傪
嶌惉偟偰帺摦揑偵偦偺儘僌偵捛壛丒峏怴偑側偝傟傞傛偆偵偟偰偄傑偡)

傢偨偟帺恎偼丄偙偆偟偨帺摦壔傪曽恓偲偟偰嵦梡偟偰偄傑偣傫丅偙傟傑偱庤摦
偱婰榐偡傞廗姷傪庣偭偰偒傑偟偨丅偨偩丄帺摦壔偲偄偆偺傕傾儕偐側偲巚偭偰
偄傞偩偗偱偡(偛棗偺傛偆偵丄僗僋儕僾僩傗僔僃儖娭悢傪嶌偭偰傒偨傝偼偟偰傞
傢偗偱偡)丅忋婰僗僋儕僾僩偱婥偵側傞揰偼丄script 僐儅儞僪偑擖偭偰偄傞偲
偙傠偱偡丅偙偺僐儅儞僪偺僜乕僗傪庢偭偰偒偰丄(僐儅儞僪棜楌偺婰榐傪堦帪掆
巭偟偨傝拞巭偟偨傝弌棃傞傛偆側)僐儅儞僪儔僀儞僷儔儊僞傪晅偗壛偊偰偐傜丄
偙傟傪巊偍偆偲峫偊偰偄傑偡丅

傢偨偟偺(崱夞偺)嵟屻偺採埬偼丄

root 儐乕僓偺僷僗偼丄'PATH=/bin' 偲偡傋偒偱偁傞

偲偄偆偙偲偱偡丅root 偺僷僗偵偦傟埲奜傪晅偗壛偊傞傋偒偱偼偁傝傑偣傫丅儖
乕僩偺嶌嬈偱巊偆僐儅儞僪偼丄/bin 偐傜偺僔儞儃儕僢僋儕儞僋偐僄僀儕傾僗丄
傕偟偔偼僔僃儖娭悢偲偄偆偐偨偪偱採嫙偡傞偐丄偁傞偄偼丄 /bin 偵偁傞僗僋
儕僾僩偐僶僀僫儕偲偡傞偐丄愨懳僷僗傪巜掕偡傞偐偺偄偢傟偐偵偡傋偒偱偡丅

偙偆偟偰偍偗偽丄root 尃尷偱嶌嬈傪偡傞恖偼丄帺暘偑偳傟傎偳僶僀僫儕傪棅傝
偵偟偰偄傞偐(偲偒偵偼丄捝偄傎偳)暘偐傞偼偢偱偡丅儅儖僠儐乕僓偺儂僗僩傪
娗棟偡傞尗柧側僔僗僥儉娗棟幰側傜丄帺暘偺 /bin 傗 /.*history 僼傽僀儖傪
掕婜揑偵挷傋偰丄側傫傜偐偺僷僞乕儞傗敳偗寠偑側偄偐偳偆偐扵偡傛偆偵側傞
偱偟傚偆丅

杮摉偵儎儖婥偺偁傞僔僗僥儉娗棟幰側傜丄帺摦壔偱偒傞売強傪扵偟摉偰丄僔僗
僥儉偺懨摉惈傪専嵏偡傞僾儘僌儔儉傪昁梫側応強偵抲偔偙偲偱丄root 尃尷偑昁
梫側嶌嬈傪偄偪偄偪偟側偄偱嵪傓傛偆偵偡傞偱偟傚偆 (僗僋儕僾僩偵傛偭偰婡
擻傪嵶偐偔挷惍偱偒傞丄僄僨傿僞傗 MTA 偦偺懠偺懳榖揑側嫄戝僾儘僌儔儉偵偮
偄偰偼丄摟夁揑側僼傽僀儖傗僨乕僞僼傽僀儖偑棙梡偝傟傞偙偲偵側傞偱偟傚偆
丅偨偲偊偽丄埆柤崅偄 vi 偺 ./.exrc 傗 emacs 偺 ./.emacs丄偝傜偵柺搢側
$EXINIT 偍傛傃慻傒崬傒僿僢僟傗僼僢僞儅僋儘偲偄偭偨傕偺偱偡)丅摉慠丄偦偆
偟偨僐儅儞僪偼丄師偺傛偆偵幚峴偡傞偙偲傕偱偒傑偡丅

  cp $data $some_users_home/tmp                                        
  su -c $origcommand $whatever_switches                                
  cp $some_users_home/tmp $data                                        

(僆僾僔儑儞傗堷悢偼丄僐儅儞僪偵傛偭偰堎側傝傑偡)

帺戭偱棙梡偡傞応崌傗儐乕僓偑帺暘偩偗偲偄偆応崌丄屻敿晹暘偱偺採埬偼戝偘
偝偱偼偁傝傑偡偑丄儅儖僠儐乕僓僔僗僥儉偺娗棟幰丄摿偵僀儞僞乕僱僢僩偵忢
帪愙懕偝傟偰偄傞(僱僢僩娭楢婇嬈側偳偺)僔僗僥儉偺娗棟幰偺応崌丄偙傟傜偼
旕忢偵桳塿側億儕僔乕偱偁傞偲巚偄傑偡丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

3.8. xdm 偱 X 僒乕僶偺儂僗僩慖戰偑偱偒傞傛偆偵偡傞愝掕曽朄乣Arrigo
Triulzi <a.triulzi@ic.ac.uk>

 

 1. xdm 傪婲摦偡傞僼傽僀儖(偨偄偰偄丄/etc/rc/rc.6 偐 /etc/rc.local 偵偁
    傝傑偡)傪奐偄偰丄xdm 偺婲摦僙僋僔儑儞偑師偺傛偆側撪梕偵側傞傛偆曇廤
    偟傑偡丅
   
                                                                
      /usr/bin/X11/xdm                                          
      exec /usr/bin/X11/X -indirect hostname                    
   
 2. /usr/lib/X11/xdm/Xservers 傪奐偄偰丄儘乕僇儖儅僔儞忋偺 X 僒乕僶傪婲
    摦偝偣傞峴傪僐儊儞僩傾僂僩偟傑偡(偡側傢偪丄婲摦偟側偄傛偆偵偟傑偡)
    丅
   
 3. 儅僔儞傪儕僽乕僩偡傞偲丄儘乕僇儖儅僔儞忋偺 X 僒乕僶傕丄儕儌乕僩儅僔
    儞偺 X 僒乕僶傕椉曽巊偊傞傛偆偵側傝傑偡丅
   
 

偙傟傪徯夘偡傞偺偼丄傢偨偟偑側傫偲偐帺暘帺恎偺僒僽僱僢僩傪愝掕偟偰尰嵼
偺忬懺偵傕偭偰偔傞嵺丄偡傋偰偺栤戣偺夝寛偵 2 廡娫偪偐偔偐偐偭偨偐傜偱偡
丅

拲堄丗屆偄 SLS (1.1.1) 傪巊偆応崌丄棟桼偼傛偔暘偐傝傑偣傫偑丄xdm 偺愝掕
峴偵 -nodaemon 偲偄偆婰弎傪擖傟偨傑傑偵偡傞偙偲傕偱偒傑偡丅偨偩偟丄偙傟
偼丄偦傟埲崀偺僶乕僕儑儞偵偼摉偰偼傑傝傑偣傫丅

劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒

4. 擔杮岅栿偵偮偄偰

東栿丗姏郪崃晇(1996/10/01) <JCD00743@niftyserve.jp>
峏怴丗愮扷桾巌(2001/03/20) <ysenda@pop01.odn.ne.jp>
峑惓丗嶳岥偝傫(2001/07/07) <keita@kyomu.net>

岆栿丒岆帤丒扙帤摍偑偁傝傑偟偨傜丄<JF@linux.or.jp> 傑偱偛楢棈偔偩偝偄丅

