From nobody@FreeBSD.org  Wed Sep  5 11:17:49 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9F15916A41B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  5 Sep 2007 11:17:49 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 8A3CD13C480
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  5 Sep 2007 11:17:49 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l85BHlZV086545
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 5 Sep 2007 11:17:47 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l85BHlnd086544;
	Wed, 5 Sep 2007 11:17:47 GMT
	(envelope-from nobody)
Message-Id: <200709051117.l85BHlnd086544@www.freebsd.org>
Date: Wed, 5 Sep 2007 11:17:47 GMT
From: Wei-Hao Syu <whsyu@ntu.edu.tw>
To: freebsd-gnats-submit@FreeBSD.org
Subject: update handbook/basics translation of traditional chinese
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         116117
>Category:       docs
>Synopsis:       update handbook/basics translation of traditional chinese
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    chinsan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 05 11:20:14 GMT 2007
>Closed-Date:    Sun Sep 16 08:24:54 GMT 2007
>Last-Modified:  Sun Sep 16 08:30:01 GMT 2007
>Originator:     Wei-Hao Syu
>Release:        6.2-STABLE
>Organization:
>Environment:
FreeBSD jasmine.ck49th318.org 6.2-STABLE FreeBSD 6.2-STABLE #6: Thu Aug 16 09:20:37 CST 2007     root@jasmine.ck49th318.org:/usr/obj/usr/src/sys/JASMINE  amd64
>Description:
please see the attached file.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

<!--
     The FreeBSD Documentation Project

     $FreeBSD: doc/zh_TW.Big5/books/handbook/basics/chapter.sgml,v 1.3 2006/06/17 10:22:45 vanilla Exp $
     Original revision: 1.142
-->

<chapter id="basics">
  <chapterinfo>
    <authorgroup>
      <author>
        <firstname>Chris</firstname>
	<surname>Shumway</surname>
	<contrib>Rewritten by </contrib>
      </author>
    </authorgroup>
    <!-- 10 Mar 2000 -->
  </chapterinfo>

  <title>UNIX ¦</title>
  
  <sect1 id="basics-synopsis">
    <title>z</title>

   <para>UӪo@N[\ FreeBSD @~tΪ򥻫OΥ\C
	jeb &unix;-like @~tΤO۳qC
	pGzoǤexܡAiHߪLC
	pGz豵Ĳ FreeBSD Az@wnJӪŪoC</para>

    <para>Ūo@AzN|F:</para>

    <itemizedlist>
      <listitem>
        <para>pϥ FreeBSD <quote>virtual consoles</quote>C</para>
      </listitem>
      <listitem>
	<para>&unix; ɮvB@覡H &os; ɮת flagsC</para>
      </listitem>
      <listitem>
	<para>w] &os; ɮרtΰtmC</para>
      </listitem>
      <listitem>
	<para>&os; ϺеcC</para>
      </listitem>
      <listitem>
	<para>p󱾸(mount)B(umount)ɮרt</para>
      </listitem>
      <listitem>
	<para>OprocessesBdaemons H signals C</para>
      </listitem>
      <listitem>
	<para>O shell AHΦpܧzw]nJҡC</para>
      </listitem>
      <listitem>
	<para>pϥΰ򥻪rs边C</para>
      </listitem>
      <listitem>
	<para>O devices M device nodes C</para>
      </listitem>
      <listitem>
	<para>&os; UϥΪ binary 榡C</para>
      </listitem>
      <listitem>
	<para>p\Ū manual pages HohTC</para>
      </listitem>
    </itemizedlist>

  </sect1>

  <sect1 id="consoles">
    <title>Virtual Consoles M׺ݾ</title>
    <indexterm><primary>virtual consoles</primary></indexterm>
    <indexterm><primary>terminals</primary></indexterm>

    <para> ܦhkiHާ@ FreeBSD A䤤@شNObr׺ݾWrC
	  pϥ FreeBSD Yi| &unix; @~tΪ¤OMuʡC
	  o@`yzO<quote>׺ݾ</quote>M 
      <quote>console</quote>AHΥiHpb FreeBSD BΥ̡C</para>

    <sect2 id="consoles-intro">
      <title>The Console</title>
      <indexterm><primary>console</primary></indexterm>

      <para>pGzSN FreeBSD ]w}ɦ۰ʶiJϧΤƼҦAtη|bҰʪ
	script ]ܵnJܲŸC zN|ݨ칳Oo˪FG</para>

      <screen>Additional ABI support:.
Local package initialization:.
Additional TCP options:.

Fri Sep 20 13:01:06 EEST 2002

FreeBSD/i386 (pc3.example.org) (ttyv0)

login:</screen>

      <para>oӰTbztΤW|ǳ\PAOӷ|ݨFC
	    ڭ̷P쪺O̫A̫OG</para>

      <programlisting>FreeBSD/i386 (pc3.example.org) (ttyv0)</programlisting>

      <para>o]tF}tΪTC zݨ쪺Ob Intel άۮeBz 
	x86 [cW檺 <quote>FreeBSD</quote> console<footnote>
          <para>oNO <literal>i386</literal> NqC `NYϱzOb 
	    Intel  386 BzW FreeBSD A@ˬO<literal>i386</literal>C
            oOABzAoܪOABz<quote>[c</quote>
	    </para>
          </footnote>C oxWr (Cx &unix; @ӦWr) O 
          <hostid>pc3.example.org</hostid>Aӱz{bݨ쪺Ot 
          console&mdash; <devicename>ttyv0</devicename>׺ݾC</para>

      <para>̫᪺@ӳ|OG</para>

      <programlisting>login:</programlisting>

      <para>oOzӭnJz<quote>bW</quote>aC 
        U@p`NiDzpnJ FreeBSDC</para>
    </sect2>

    <sect2 id="consoles-login">
      <title>nJ FreeBSD</title>

      <para>FreeBSD O@ multiuserBmultiprocessing tΡC 
        oO@ӥW١AOb@WiHPɳQPHϥΡAPɥiHܦh{tΡC</para>

      <para>C@ئhϥΪ̨tγݭniH뤣P<quote>ϥΪ</quote>kC
        b FreeBSD (HΩҦ &unix;-like @~t) 
        AҦϥΪ̦b{e<quote>nJ</quote>tΡC 
	CӨϥΪ̳@տWSbW
        (<quote>username</quote>)αKX(<quote>password</quote>)C
        FreeBSD b\ϥΪ̰{eN|ݳoӰDC</para>

      <indexterm><primary>startup scripts</primary></indexterm>
      <para>b FreeBSD }ö]_ʪ script <footnote>
        <para>oǰ_ʪ script Ob}ɭ FreeBSD |۰ʰ檺{C
         L̥Dn\ONҦӰ檺F]wnAñNz]wI檺AȱҰʡC
	 </para>
      </footnote>AN|LXܦrnDzJTbW١G</para>

      <screen>login:</screen>

      <para>boӽdҸ̡Aڭ̰]zbO<username>john</username>C 
        bܦrBJ
	<literal>john</literal> ëU <keycap>Enter</keycap>C
	۱zӷ|ݨt@ӴܦrnzJ<quote>KX</quote>G
      </para>

      <screen>login: <userinput>john</userinput>
Password:</screen>

      <para>J <username>john</username> KXAAU 
	<keycap>Enter</keycap>C
	JKX <emphasis>|ܦbùW</emphasis>C
	zݭnߡAo˰OFwWDC</para>

      <para>pGzJFTKXAzӤwgnJ FreeBSDC
	{bNiHթҦiΪOFC</para>

      <para>zӷ|ݨ<acronym>MOTD</acronym> 
        (YTBMessages Of The Day)A᭱۩ROܦr
        (@ <literal>#</literal>,<literal>$</literal>, άO 
	<literal>%</literal> r)C oNܱzwg\nJ 
	FreeBSD FC</para>
    </sect2>

    <sect2 id="consoles-virtual">
      <title>h Console</title>

      <para>b@ Console U &unix; MOSDAM
        FreeBSD OiHPɰܦh{C 
         FreeBSD o˥iHPɰ@j{@~tΡAu@
        console iHJObOIOC
        b<quote>virtual consoles</quote>NܦΤFC</para>

      <para> FreeBSD iHQ]wPɦܦh 
        virtual consoleAδXӫ䪺զXNiHq@
        virtual console O virtual console hC
        C@ console ۤwPXWDA qY@
        virtual console U@ӪɭԡAFreeBSD
        |ABzLJοùXC</para>
          
      <para>FreeBSD OdFSOզXӤ console <footnote>
        <para>b &man.syscons.4;B&man.atkbd.4;B&man.vidcontrol.1;BH
          &man.kbdcontrol.1; manual page A FreeBSD  console
          LXʵ{ԲӪ޳NC ڭ̦bo̤QײӸ`A쪺ŪHɥiHb 
          manual page dB@覡ԲӥB㪺C</para>
	    </footnote>C ziH
        <keycombo><keycap>Alt</keycap><keycap>F1</keycap></keycombo>B
        <keycombo><keycap>Alt</keycap><keycap>F2</keycap></keycombo>B
        <keycombo><keycap>Alt</keycap><keycap>F8</keycap></keycombo>
	Ӥ FreeBSD P consoleC </para>
    
      <para> zq@ console U@ӪɭԡAFreeBSD 
	|BzùXxsΦ^_C
	oN<quote>n</quote>ܦh<quote></quote>ùMLiHzJO 
        FreeBSD C bY@ console W檺{ä|]O console
        ӰAzt@ console ɭԡAL̷|~C</para>
    </sect2>

    <sect2 id="consoles-ttys">
      <title><filename>/etc/ttys</filename> </title>

      <para>FreeBSD w] console `@ 8 ӡA
        oëDwʳWwAziP]woǵ console ƶqWC 
	 console s]wb 
	<filename>/etc/ttys</filename> oɮפ]wC</para>

      <para>iH <filename>/etc/ttys</filename> ɮרӳ]w
	FreeBSD  consoleC ɮפCDѤr(Ӧ}YS 
	<literal>#</literal> or)O]w׺ݾε consoleC
	FreeBSD w] 9 ӵ console uҰ 8 ӡA]NOHUH
	<literal>ttyv</literal>	}YX]wC</para>

      <programlisting># name  getty                           type    status          comments
#
ttyv0   "/usr/libexec/getty Pc"         cons25  on  secure
# Virtual terminals
ttyv1   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv2   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv3   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv4   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv5   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv6   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv7   "/usr/libexec/getty Pc"         cons25  on  secure
ttyv8   "/usr/X11R6/bin/xdm -nodaemon"  xterm   off secure</programlisting>

      <para>oɨC쪺]wPLﶵAаѾ\ 
	&man.ttys.5; C</para>
    </sect2>

    <sect2 id="consoles-singleuser">
      <title>Single User Ҧ Console</title>

      <para> <quote>single user Ҧ</quote> Цb 
	<xref linkend="boot-singleuser">
        o䦳ԺɤСC  b single user ҦɡAϥΪ console 
	u@ӡAõL console iΡC  single user Ҧ]wȥiHb
	<filename>/etc/ttys</filename> ɰվC UH 
	<literal>console</literal> }YANOFG</para>

      <programlisting># name  getty                           type    status          comments
#
# If console is marked "insecure", then init will ask for the root password
# when going to single-user mode.
console none                            unknown off secure</programlisting>

      <note>
        <para>b <literal>console</literal> eѦAiH⨺檺
	  <literal>secure</literal> אּ <literal>insecure</literal>A
	  p@ӡAY FreeBSD iJ single user ҦA
	  |nDzJ <username>root</username> KXC</para>

	<para><emphasis>мfVҼ{O_nאּ 
	  <literal>insecure</literal></emphasis>C  ]U@ѰO 
	  <username>root</username> KXܡAYnnJ single user 
	  ҦNǳ·ФFC٦L覡iHnJA藍 FreeBSD
	  }{ǪHӨAN|۷ƤC
	  </para>
      </note>
    </sect2>
  </sect1>

  <sect1 id="permissions">
    <title>v</title>
    <indexterm><primary>UNIX</primary></indexterm>

    <para>FreeBSD ۩ BSD &unix;A~ӤFXӭn &unix; C
      ]̩AO@ multi-user @~tΡC
      iHPɳBzhHhuAtdɻP޲zӦۨCϥΪ̹
      wи˸mBg]ơBO CPU ɶnDC</para>

    <para>]]tί䴩hϥΪ̡AҥHtκ޲z@v
      ӨMw֥iHŪBgJΰ귽C
      ovOϥΤTդKi쪺ƦrxsA@եNɮתҦ
      A@եNɮשݪsաAӳ̫@իhNLҦHC
      ܳoǼƦr覡pU:</para>

    <indexterm><primary>permissions</primary></indexterm>
    <indexterm>
      <primary>file permissions</primary>
    </indexterm>
    <informaltable frame="none" pgwide="1">
      <tgroup cols="3">
	<thead>
	  <row>
	    <entry></entry>
	    <entry>v</entry>
	    <entry>ؿ</entry>
	  </row>
	</thead>

	<tbody>
	  <row>
	    <entry>0</entry>
	    <entry>iŪ, igJ, i</entry>
	    <entry><literal>---</literal></entry>
	  </row>

	  <row>
	    <entry>1</entry>
	    <entry>iŪ, igJ, i</entry>
	    <entry><literal>--x</literal></entry>
	  </row>

	  <row>
	    <entry>2</entry>
	    <entry>iŪ, igJ, i</entry>
	    <entry><literal>-w-</literal></entry>
	  </row>

	  <row>
	    <entry>3</entry>
	    <entry>iŪ, igJ, i</entry>
	    <entry><literal>-wx</literal></entry>
	  </row>

	  <row>
	    <entry>4</entry>
	    <entry>iŪ, igJ, i</entry>
	    <entry><literal>r--</literal></entry>
	  </row>

	  <row>
	    <entry>5</entry>
	    <entry>iŪ, igJ, i</entry>
	    <entry><literal>r-x</literal></entry>
	  </row>

	  <row>
	    <entry>6</entry>
	    <entry>iŪ, igJ, i</entry>
	    <entry><literal>rw-</literal></entry>
	  </row>

	  <row>
	    <entry>7</entry>
	    <entry>iŪ, igJ, i</entry>
	    <entry><literal>rwx</literal></entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>
    <indexterm>
      <primary><command>ls</command></primary>
    </indexterm>
    <indexterm><primary>directories</primary></indexterm>

    <para>ϥΫO &man.ls.1; ziH <option>-l</option> ѼơA
      ˵ԲӪؿMC
      M椤쪺T]tɮ׹Ҧ̡BsդΨLHvC
      bHK@ӥؿU <command>ls -l</command>A|ܦpUG:
      </para>

    <screen>&prompt.user; <userinput>ls -l</userinput>
total 530
-rw-r--r--  1 root  wheel     512 Sep  5 12:31 myfile
-rw-r--r--  1 root  wheel     512 Sep  5 12:31 otherfile
-rw-r--r--  1 root  wheel    7680 Sep  5 12:31 email.txt
..</screen>

    <para>bo̧iұzӦpϤ <command>ls -l</command> 
      Ĥ@T:</para>

    <screen>-rw-r--r--</screen>

    <para>Ĥ@ (̥) rΨӪܳoɮתA
      зɮץH~A|ؿBSr˸m (Special character device)B
      Socket ΨLSɮ׸˸m (Special pseudo-file device)A
      bҷA<literal>-</literal> ܸɮ׬@ӼзǪɮסC
      dҤUӪTӦrA<literal>rw-</literal>
      NҦ̹ɮ׾֦vC AUӪTӦrA
      <literal>r--</literal> hNsչɮ׾֦vA
      ̫TӦrA<literal>r--</literal> hNLHɮ׾֦vC
      }鸹 (-) ܨSvAdҤoɮתvA
      u\ҦŪBgJɮסAsեHΨLHȯŪɮסC
      ھڥHWAvɮץiHϥ <literal>644</literal> ӪܡA
      CռƦrONɮתTvC</para>

    <para>HWO覡AtθӦp󱱨˸mvH ڤW FreeBSD
      jhwи˸mNpPɮסA{iH}ҡBŪHμgJƦp@ɮסC
      oǯS˸mɮ (Special device file) xs <filename>/dev</filename> 
      ؿC</para>

    <para>
      ؿ]PpɮסA֦ŪBgJΰ檺vAbvWPɮצ㪺tC
      ؿQХܬiɡANiHϥ <quote>cd</quote> 
      (ؿ) iJӥؿC]NsbؿwɦWɮ
      (MAɮפ֦ۤvv)</para>

    <para>רAnCXؿeA֦ؿŪvC
      ӷnRwɦWɮ׮ɡA]֦ɮשҦbؿgJ
      <emphasis>H</emphasis> 檺vC</para>

    <para>٦@vAovDnbSpϥΡAp setuid binaries 
       sticky directoriesC 
      pGzٷQDhɮvTΨϥΤkAаȥѾ\ 
      &man.chmod.1; C</para>

    <sect2>
      <sect2info>
	<authorgroup>
	  <author>
	    <firstname>Tom</firstname>
	    <surname>Rhodes</surname>
	    <contrib>Contributed by </contrib>
	  </author>
	</authorgroup>
      </sect2info>

      <title>vŸ</title>
      <indexterm><primary>permissions</primary><secondary>symbolic</secondary></indexterm>

      <para>
	vŸiٰŸܡAϥΦr覡ӨNϥμƭȨӳ]wɮשΥؿvC
	Ÿܪ榡̧Ǭ (YH)(ʧ@)(v)AiϥΪŸpU:</para>

      <informaltable frame="none" pgwide="1">
	<tgroup cols="3">
	  <thead>
	    <row>
	      <entry></entry>
	      <entry>r</entry>
	      <entry>Nq</entry>
	    </row>
	  </thead>

	<tbody>
	  <row>
	    <entry>(YH)</entry>
	    <entry>u</entry>
	    <entry>ϥΪ</entry>
	  </row>

	  <row>
	    <entry>(YH)</entry>
	    <entry>g</entry>
	    <entry>sթҦ</entry>
	  </row>

	  <row>
	    <entry>(YH)</entry>
	    <entry>o</entry>
	    <entry>L</entry>
	  </row>

	  <row>
	    <entry>(YH)</entry>
	    <entry>a</entry>
	    <entry>Ҧ (<quote>world</quote>)</entry>
	  </row>

	  <row>
	    <entry>(ʧ@)</entry>
	    <entry>+</entry>
	    <entry>W[v</entry>
	  </row>

	  <row>
	    <entry>(ʧ@)</entry>
	    <entry>-</entry>
	    <entry>v</entry>
	  </row>

	  <row>
	    <entry>(ʧ@)</entry>
	    <entry>=</entry>
	    <entry>wv</entry>
	  </row>

	  <row>
	    <entry>(v)</entry>
	    <entry>r</entry>
	    <entry>Ū</entry>
	  </row>

	  <row>
	    <entry>(v)</entry>
	    <entry>w</entry>
	    <entry>gJ</entry>
	  </row>

	  <row>
	    <entry>(v)</entry>
	    <entry>x</entry>
	    <entry></entry>
	  </row>

	  <row>
	    <entry>(v)</entry>
	    <entry>t</entry>
	    <entry>Sticky bit</entry>
	  </row>

	  <row>
	    <entry>(v)</entry>
	    <entry>s</entry>
	    <entry>Set UID  GID</entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>

    <para>peP˨ϥ &man.chmod.1; Oӳ]wAϥΪѼƬoǦrC
	ҦpAziHϥΤUCOTLϥΪ̦sɮ <replaceable>FILE</replaceable>:</para>

    <screen>&prompt.user; <userinput>chmod go= FILE</userinput></screen>

    <para>YӥHWŸܥiHϥγr(,)ϹjC
	ҦpAUCON|sդΨLH
	ɮ <replaceable>FILE</replaceable> gJvA
	èϩҦH(<quote>world</quote>)ɦvC</para>

    <screen>&prompt.user; <userinput>chmod go-w,a+x <replaceable>FILE</replaceable></userinput></screen>

<!--
    <para>Most users will not notice this, but it should be pointed out
      that using the octal method will only set or assign permissions to
      a file; it does not add or delete them.</para>
-->
    </sect2>

    <sect2>
      <sect2info>
	<authorgroup>
	  <author>
	    <firstname>Tom</firstname>
	    <surname>Rhodes</surname>
	    <contrib>Contributed by </contrib>
	  </author>
	</authorgroup>
      </sect2info>

      <title>&os; ɮ׺X(Flag)</title>

      <para>Fe쪺ɮv~A&os; 䴩ϥ <quote>ɮ׺X</quote>C
	oǺXмW[Fɮתwʤκ޲zʡA]tؿC</para>

      <para>ɮ׺XмW[F޲zʡATObYǮɭ <username>root</username> 
	|N~Nɮ׭קβC</para>

      <para>ק諸ɮ flag Ȼݭnϥξ֦² &man.chflags.1; uC
	ҦpAХܨtθTRXЩɮ
	<filename>file1</filename>AϥΤUCO:</para>

      <screen>&prompt.root; <userinput>chflags sunlink <filename>file1</filename></userinput></screen>

      <para>YntθTRXСA
	uݭn²b <option>sunlink</option> e[W <quote>no</quote>AҦp:</para>

      <screen>&prompt.root; <userinput>chflags nosunlink <filename>file1</filename></userinput></screen>

      <para>ϥ &man.ls.1; ΰѼ <option>-lo</option> i˵ɮץثeX:</para>

      <screen>&prompt.root; <userinput>ls -lo <filename>file1</filename>
	</userinput></screen>

      <para>XGpU:</para>

      <programlisting>-rw-r--r--  1 trhodes  trhodes  sunlnk 0 Mar  1 05:54 file1</programlisting>

      <para>hƪXжȯ <username>root</username> 
	ϥΪ̨ӼХܩβAӳXХiɮשҦ̳]wC
	o̫ĳ޲z̾\Ū &man.chflags.1;  &man.chflags.2; 
	ohTC</para>
    </sect2>
  </sect1>
  
  <sect1 id="dirstructure">
    <title>ؿc</title>
    <indexterm><primary>directory hierarchy</primary></indexterm>

    <para>{ FreeBSD ؿ[cANitΦ¦zѡC
      ̭nLӥؿڥؿANO <quote>/</quote> 
      ؿAoؿ|b}ɲĤ@ӥ (mount)A䤤̭ 
      multi-user ާ@򥻨tΡCڥؿ]|OCɮרtΤI
      (mount point)C</para>

    <para>INOsWɮרtΡA౵WڥؿɮרtΪؿC
      b <xref linkend="disk-organization"> o惡ԲӤСC
      зǪI]AF 
      <filename>/usr</filename>, <filename>/var</filename>, <filename>/tmp</filename>,
      <filename>/mnt</filename>AH <filename>/cdrom</filename>C  
      oǥؿq`|Ob <filename>/etc/fstab</filename> ]wɤC
      <filename>/etc/fstab</filename> OOUɮרtΤάIC
      jb <filename>/etc/fstab</filename> 
      OɮרtΡA|b}ɥ &man.rc.8; script Ӧ۰ʱAD̦]w
      <option>noauto</option> ﶵCӸ`iѾ\ <xref linkend="disks-fstab">C
      </para>

    <para>ɮרtά[c㻡iѾ\ &man.hier.7;C  
      {bOAڭ̤jP@s`ؿǧaC</para>

    <para>
      <informaltable frame="none" pgwide="1">
        <tgroup cols="2">
	  <thead>
	    <row>
	      <entry>ؿ</entry>
	      <entry></entry>
	    </row>
	  </thead>
	  <tbody valign="top">
            <row>
	      <entry><filename class="directory">/</filename></entry>
	      <entry>ɮרtΪڥؿC</entry>
            </row>
	    
	    <row>
	      <entry><filename class="directory">/bin/</filename></entry>
	      <entry>A single-user  multi-user 򥻤uC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/boot/</filename></entry>
	      <entry>@~tζ}L{|Ψ쪺{B]wɡC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/boot/defaults/</filename></entry>
	      <entry>w]}Ұʳ]wɡAԱаѾ\ &man.loader.conf.5;C</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/dev/</filename></entry>
	      <entry>Device nodesAԱаѾ\ &man.intro.4;C</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/etc/</filename></entry>
	      <entry>tγ]wɤΤ@ script ɡC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/etc/defaults/</filename></entry>
	      <entry>w]tγ]wɡAԱаѾ\ &man.rc.8;C</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/etc/mail/</filename></entry>
	      <entry>MTA(Mail Transport Agent)]wɡAO &man.sendmail.8;C
		</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/etc/namedb/</filename></entry>
	      <entry><command>named</command> ]wɡAԱаѾ\
	      &man.named.8;C</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/etc/periodic/</filename></entry>
	      <entry>CBCgBCzL &man.cron.8;; 檺wƵ{ scriptA
		ԱаѾ\ &man.periodic.8;C</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/etc/ppp/</filename></entry>
	      <entry><command>ppp</command> ]wɡAԱаѾ\ 
	      &man.ppp.8;C</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/mnt/</filename></entry>
	      <entry>tκ޲z̺DΥR{ɱIťؿC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/proc/</filename></entry>
	      <entry>Process ɮרtΡAԱаѾ\ &man.procfs.5; 
	      &man.mount.procfs.8;C</entry>
	    </row>

	    <row>
	      <entry><filename class="directory">/rescue/</filename></entry>
	      <entry>ϴγ~@ statically linked {AԱаѾ\ 
		&man.rescue.8;C</entry>
	    </row>

	    <row>
	      <entry><filename class="directory">/root/</filename></entry>
	      <entry><username>root</username> baؿC</entry>
	    </row>

	    <row>
	      <entry><filename class="directory">/sbin/</filename></entry>
	      <entry> single-user  multi-user ҨϥΪtε{κ޲zuC</entry>
	    </row>
	    
	    
	    <row>
	      <entry><filename class="directory">/tmp/</filename></entry>
	      <entry>{ɮסC  @ӨA}
		<filename class="directory">/tmp</filename> F|QMC
		ӳq`|N memory-based ɮרtαb 
		<filename class="directory">/tmp</filename> WC
		oǺƥizL tmpmfs  &man.rc.conf.5; ܼƨӦ۰ʧC
		(άOb 
		<filename>/etc/fstab</filename> ]wAԱаѾ\ &man.mdmfs.8;C)</entry>
	    </row>
	    
	    
	    <row>
	      <entry><filename class="directory">/usr/</filename></entry>
	      <entry>DnOϥΪ̩Ҧw˪u{Bε{sBC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/usr/bin/</filename></entry>
	      <entry>`ΤuB}ouBγnC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/usr/include/</filename></entry>
	      <entry>з C include  header ɮ׮wC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/usr/lib/</filename></entry>
	      <entry>禡wsBC</entry>
	    </row>
	    
	    
	    <row>
	      <entry><filename class="directory">/usr/libdata/</filename></entry>
	      <entry>LUu㪺ɡC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/usr/libexec/</filename></entry>
	      <entry>t daemons ΨtΤu{(zLL{Ӱ)C</entry>
	    </row>
	    
	    <row>
	      <entry><filename
	      class="directory">/usr/local/</filename></entry>

	      <entry>s@Ǧۦw˪ɡB禡wC  PɡA]O FreeBSD
		ports [cw]w˥ؿC  <filename>/usr/local</filename> 
		ؿ[cjPP <filename>/usr</filename> ۦPAԱаѾ\ 
		&man.hier.7; C man ؿҥ~A̬Ob
		<filename>/usr/local</filename> UAӫD <filename>/usr/local/share</filename>A
		 ports Ҧw˪hb 
	        <filename>share/doc/<replaceable>port</replaceable></filename>C
	      </entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/usr/obj/</filename></entry>
	      <entry>bsĶ <filename>/usr/src</filename> 
		ؿɩҲͪ[c object ɮסC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/usr/ports</filename></entry>
	      <entry>FreeBSD Ports Collection (optional)C</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/usr/sbin/</filename></entry>
	      <entry>t daemon ΨtΤu(ѨϥΪ̰)C</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/usr/share/</filename></entry>
	      <entry>U[cҦ@qɮסC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/usr/src/</filename></entry>
	      <entry>BSD lX(ΦۦsW)C</entry>
	    </row>
	    
	    <row>
	      <entry><filename
	      class="directory">/usr/X11R6/</filename></entry>
	      <entry>X11R6 M󪺰ɡB禡w(optional)C</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/var/</filename></entry>
	      <entry>sUإγ~ log ɡB{ɩμȮɦsBCLζl 
		spool ɮסCɭԡAmemory-based ɮרtΤ]|b
		<filename class="directory">/var</filename>C
		oǺƥizL varmfs  &man.rc.conf.5 
		ܼƨӦ۰ʧC(άOb 
		<filename>/etc/fstab</filename> ]wAӸ`аѾ\ 
		&man.mdmfs.8;C)</entry>
	    </row>
	    
	    
	    <row>
	      <entry><filename class="directory">/var/log/</filename></entry>
	      <entry>UtΰO log ɮסC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/var/mail/</filename></entry>
	      <entry>UϥΪ̪ mailbox ɮסC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/var/spool/</filename></entry>
	      <entry>UئLBltΪ spool ؿC</entry>
	    </row>
	    
	    <row>
	      <entry><filename class="directory">/var/tmp/</filename></entry>
	      <entry>{ɮסC
		oɮצb}q`|OdAD
		<filename class="directory">/var</filename>
		Oݩ memory-based ɮרtΡC</entry>
	    </row>
	    
	    <row>
	      <entry><filename>/var/yp</filename></entry>
	      <entry>O NIS mapsC</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </para>

  </sect1>

  <sect1 id="disk-organization">
      <title>Ϻв´</title>

      <para> FreeBSD ΨӴMɮת̤pNOɮתW٤FC
	ɮתW٦jpgAҥH <filename>readme.txt</filename>
	M <filename>README.TXT</filename> OӤPɮסC
	FreeBSD äϥΰɦW (<filename>.txt</filename>)
        ӧPOoO@ӵ{ɡBɩάOLɮסC</para>

      <para>ɮצsbؿ̭C
	@ӥؿiSɮסA]i঳nXʭɮסC
        ؿ]iH]tLؿFziHإ߶hؿHKƪ޲zC
	</para>

      <para>ɮשΥؿOǥѵwɮשΥؿW١AM[W׽uŸ
	(<literal>/</literal>)FAݭn[WLؿW١C 
        pGz@ӥؿ <filename>foo</filename> A̭@ӥؿs@
        <filename>bar</filename> AoӥؿS]tF@ӥs 
        <filename>readme.txt</filename> 
        ɮסAoɮתWAΪ̻ɮת<firstterm>|</firstterm>NO
        <filename>foo/bar/readme.txt</filename> C</para>

      <para>ؿɮxsbɮרtΤC
        Cɮרtγߤ@@ӳ̤WhؿAs<firstterm>ڥؿ 
	(root directory)</firstterm>CMboӮڥؿU~঳LؿC
	</para>

      <para>ثejMLzιL@~tγthC
	٬OǤ@˪aNOFAҦp &ms-dos;  <literal>\</literal>
	ɮשMؿW٪jŸA &macos; hO <literal>:</literal>
        ŸC</para>

      <para>FreeBSD |èSϥκϺоNΨLϺЦW١C 
        ]AziHϥι <filename>c:/foo/bar/readme.txt</filename> 
        oˤlɮצW١C</para>

      <para>۹諸Ab FreeBSD 
	tΤ@ɮרtγQw<firstterm>ɮרt</firstterm>C
        ɮרtΪڥؿ <literal>/</literal> ܡC 
	MLɮרtΦA<firstterm> (mount)</firstterm> 
	bɮרtΤUC]Lױz FreeBSD 
	tΤWhwСAC@ӥؿݰ_ӴNbP@ӺϺФWC</para>

      <para>]zTɮרtΡAOs@ <literal>A</literal>B
        <literal>B</literal>  <literal>C</literal> C
	Cɮרtγ]tӥؿAs
        <literal>A1</literal>B<literal>A2</literal> (̦o 
        <literal>B1</literal>B<literal>B2</literal>  
        <literal>C1</literal>B<literal>C2</literal>)C</para>

      <para> <literal>A</literal> DnɮרtΡFpGz 
	<command>ls</command> OdݦؿeAz|ݨӤlؿG 
	<literal>A1</literal>  <literal>A2</literal> ApUҥܡG</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="install/example-dir1" format="EPS">
	</imageobject>

	<textobject>
	  <literallayout class="monospaced"> /
 |
 +--- A1
 |
 `--- A2</literallayout>
	</textobject>
      </mediaobject>

      <para>@ɮרtΥHؿΦt@ɮרtΤWC
	]A]zN <literal>B</literal>  <literal>A1</literal>
	WAh <literal>B</literal> ڥؿNܦF 
	<literal>A1</literal>AӦb <literal>B</literal> 
	Uؿ|]H:</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="install/example-dir2" format="EPS">
	</imageobject>

	<textobject>
	  <literallayout class="monospaced"> /
 | 
 +--- A1
 |     |
 |     +--- B1
 |     |
 |     `--- B2
 |
 `--- A2</literallayout>
	</textobject>
      </mediaobject>

      <para>b <literal>B1</literal> 	<literal>B2</literal> 
	ؿɮץgѸ| <filename>/A1/B1</filename> 
	 <filename>/A1/B2</filename> ~FC
        ҦӦb <filename>/A1</filename> ɮ׷|ȮɳQð_ӡA 
	<literal>B</literal> Qu<firstterm> 
	(unmounted)</firstterm>v~|A{XӡC</para>

      <para>pG <literal>B</literal> b <literal>A2</literal> 
	WAh|ܦG</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="install/example-dir3" format="EPS">
	</imageobject>

	<textobject>
	  <literallayout class="monospaced"> /
 |
 +--- A1
 |
 `--- A2
       |
       +--- B1
       |
       `--- B2</literallayout>
	</textobject>
      </mediaobject>

      <para>W|O <filename>/A2/B1</filename>  
	<filename>/A2/B2</filename>C</para>

      <para>ɮרtΥiHbLɮרtΪؿWC
	򤧫eҤlA<literal>C</literal> ɮרtΥiHbɮרt
	<literal>B</literal>  <literal>B1</literal> ؿWApϩҥܡG
	</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="install/example-dir4" format="EPS">
	</imageobject>
	
	<textobject>
	  <literallayout class="monospaced"> /
 |
 +--- A1
 |
 `--- A2
       |
       +--- B1
       |     |
       |     +--- C1
       |     |
       |     `--- C2
       |
       `--- B2</literallayout>
	</textobject>
      </mediaobject>

      <para>Ϊ <literal>C</literal>  <literal>A</literal> 
        <literal>A1</literal> ؿWG</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="install/example-dir5" format="EPS">
	</imageobject>

	<textobject>
	  <literallayout class="monospaced"> /
 |
 +--- A1
 |     |
 |     +--- C1
 |     |
 |     `--- C2
 |
 `--- A2
       |
       +--- B1
       |
       `--- B2</literallayout>
	</textobject>
      </mediaobject>

      <para>pGzx &ms-dos; ܡAoM <command>join</command>
	O (MۦP)C</para>

      <para>@뱡pUzݭn߳oǪFC 
	Dznw˷sϺСAMq`bzw FreeBSD 
        ɫإߦnɮרtΨèMwnnbBN|AʤFC</para>

      <para>ziHϥγ@@Ӥjɮרt (root file system) 
	ӤإߨLɮרtΡC o˦nB]aBC</para>

      <itemizedlist>
	<title>ϥΦhɮרtΪnB</title>
      
	<listitem>
	  <para>PɮרtΦbWɭԥiHP<firstterm>Ѽ</firstterm>C  
	    |ҨӻADԷVziHNɮרtγ]ŪAHקKpߧRέקﱼnɮסC
	    NϥΪ̥igJɮרt (Ҧp <filename>/home</filename>) 
	    WߥXӤ]iHL̥ <firstterm>nosuid</firstterm> 
	    ѼƱAﶵiHboɮרtΤɪ
	    <firstterm>suid</firstterm>/<firstterm>guid</firstterm> 
	    bits ġA]\iHtΧwC</para>
	</listitem>

	<listitem>
	  <para>FreeBSD |۰ʮھڱzɮרtΪϥΤ覡Ӱ̨Ϊɮװtm覡C
	    ]A@ӦܦhpɮסB``gJɮרtθuXӸjɮתɮרtΰtmO@˪C pGzu@@ӤjɮרtΡAoNSΤFC</para>
	</listitem>
	
	<listitem>
	  <para>FreeBSD ɮרtΦbqɭԫíTC 
          MӡAbYǭnɭ԰qM|ɮרtεcyl`C
          Φ\hɮרtΪܦbtΦbq`ҰʡAHKzbݭnɭԱNƥƦ^s^ӡC</para>
	</listitem>
      </itemizedlist>

      <itemizedlist>
	<title>ϥγ@ɮרtΪnB</title>

	<listitem>
	  <para>ɮרtΪjpOTwC 
	    zw FreeBSD 
	    ɭӷ|w@ӤjpAiOӱzi|QŶ[jC
	    pGSƥܬOFF
	    zNɮרtέsإ߬zݭnjpAMNƥ^s^ӡC</para>

	  <important>
	    <para>FreeBSD&nbsp;4.4 ᪺@ӫOG &man.growfs.8;
	      iH}ܧɮרtΪjpC</para>
	  </important>
	</listitem>
      </itemizedlist>
    
      <para>ɮרtΥ]tbΰϸ̭C 
        ] &os; ŧ &unix [cAoΰϩM@봣쪺ΰ 
	(Ҧp &ms-dos; ΰ) PC C@ӤΰϥѤ@ӥN(r)ܡAq 
	<literal>a</literal>  <literal>h</literal>C
        CӤΰϥu]t@ɮרtΡC
        ]F`ɮרtΦPIӪɮרtΥ~A]iHΥ]tLΰϥNӪܡC</para>

      <para>FreeBSD ]|ϺЪŶӷ <firstterm>swap space</firstterm>C
        Swap space  FreeBSD @<firstterm>O</firstterm>ΡC
        ozqn֦ڧhOC 
         FreeBSD OΧɭԡA|@ǥثeSΨ쪺Ʋ 
	swap spaceAMbΨ쪺ɭԲ^h (PɲXSΨ쪺)C</para>

      <para>YǤΰϦDҪϥΤ覡pUG</para>

      <informaltable frame="none" pgwide="1">
	<tgroup cols="2">
	  <colspec colwidth="1*">
	  <colspec colwidth="5*">

	  <thead>
	    <row>
	      <entry>ΰ</entry>

	      <entry>D</entry>
	    </row>
	  </thead>

	  <tbody valign="top">
	    <row>
	      <entry><literal>a</literal></entry>

	      <entry>q`]tɮרt (root file system)</entry>
	    </row>

	    <row>
	      <entry><literal>b</literal></entry>

	      <entry>q`O swap space</entry>
	    </row>

	    <row>
	      <entry><literal>c</literal></entry>

	      <entry>q`M slice jp@ˡA@Ƿ|Ψ slice 
		u{ (Ҧpwayˬdu) ӨϥΡC
		@ӻzӤ|ɮרtΫإߦboӤΰϡC</entry>
	    </row>

	    <row>
	      <entry><literal>d</literal></entry>

	      <entry>ΰ <literal>d</literal> 
		gNSNqAOwgAϥΡC
		ҥH{b <literal>d</literal> 
		NML@몺ΰϬۦPFC</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>

      <para>Cӥ]tɮרtΪΰϬOsbҿת 
	<firstterm>slice</firstterm> ̭C
        FreeBSD  slice NO`ڭ̺٬ΰ (partition) FC
        P˦aA|oˤl٩I]O] FreeBSD  &unix; mC
         slice OsAq 1 s 4 C</para>

	<indexterm><primary>slices</primary></indexterm>
	<indexterm><primary>partitions</primary></indexterm>
	<indexterm><primary>dangerously dedicated</primary></indexterm>

      <para>slice Xb˸mW٫᭱A@Ӧr 
	<literal>s</literal>AMq 1 }lsUhC
        ] <quote>da0<emphasis>s1</emphasis></quote> NOĤ@ SCSI 
	wЪĤ@ sliceC @ӺϺФWu঳|ӹ骺 sliceAOb骺
	slice ziHiA޿ sliceC oǩ slice sq 5 
	}lAҥH <quote>ad0<emphasis>s5</emphasis></quote> OĤ@ IDE
	wФWĤ@ө sliceC ɮרtΦb˸m (device) ̴NOb@ slice
	C</para> 

      <para>SlicesB<quote>dangerously dedicated</quote>
        ҦϺоAHΨL]t<firstterm>ΰ</firstterm>ϺгOHr
        <literal>a</literal>r<literal>h</literal>sӪܡC
        sOb˸mW٪᭱A] 
	<quote>da0<emphasis>a</emphasis></quote> OϺо da WĤ@
	<quote>dangerously dedicated</quote>ҦΰϡC
	 <quote>ad1s3<emphasis>e</emphasis></quote> 
        hOĤG IDE wФWĤT slice ĤӤΰϡC</para>
	
      <para>̫Aڭ̴NiHtΤWCӺϺгϤXӤFC
        @ӺϺЪWٷ|@ӥNXӪܳoӺϺЪA۬O@ӼƦrAܳoO@ӺϺСC
        o slice CӺϺнsq 0 }l@ˡC
        `NXiHѦ <xref linkend="basics-dev-codes">.</para>

      <para>nѷӤ@ӤΰϪɭԡAFreeBSD ݭnz@ֿJ]toӤΰϪ 
	slice κϺоW١FnѷӤ@ slice ɭԡA]J]to 
	slice ϺЦW١C 򰵩OH CXϺЦW١AM 
	<literal>s</literal> [W slice sA̫AJΰϦrNC
        dҥiHѦ <xref linkend="basics-disk-slice-part">.</para>

      <para><xref linkend="basics-concept-disk-model"> 
	ܽdF@Ӱ򥻪ϺФҦA۫HzUC</para>

      <para>nw FreeBSDAzظmϺЪ sliceA۩ slice إ߭n
	FreeBSD ΪΰϡC ̫boǤΰϤإɮרt ( swap space)
	èMwnNoɮרtα̡C</para>

      <table frame="none" pgwide="1" id="basics-dev-codes">
	<title>ϺоNX</title>

	<tgroup cols="2">
          <colspec colwidth="1*">
          <colspec colwidth="5*">

	  <thead>
	    <row>
	      <entry>NX</entry>
	    
	      <entry>Nq</entry>
	    </row>
	  </thead>

	  <tbody>
	    <row>
	      <entry><devicename>ad</devicename></entry>

	      <entry>ATAPI (IDE) Ϻо</entry>
	    </row>

	    <row>
	      <entry><devicename>da</devicename></entry>
	      
	      <entry>SCSI sϺо</entry>
	    </row>
	    
	    <row>
	      <entry><devicename>acd</devicename></entry>
	      
	      <entry>ATAPI (IDE) о</entry>
	    </row>
	    
	    <row>
	      <entry><devicename>cd</devicename></entry>
	      
	      <entry>SCSI о</entry>
	    </row>
	    
	    <row>
	      <entry><devicename>fd</devicename></entry>
	      
	      <entry>nо</entry>
	    </row>
	  </tbody>
	</tgroup>
      </table>
      
      <example id="basics-disk-slice-part">
	<title>ϺСBslice ΤΰϩRWd</title>
	
	<informaltable frame="none" pgwide="1">
	  <tgroup cols="2">
            <colspec colwidth="1*">
            <colspec colwidth="5*">

	    <thead>
	      <row>
		<entry>W</entry>
		
		<entry>Nq</entry>
	      </row>
	    </thead>
	    
	    <tbody>
	      <row>
		    <entry><literal>ad0s1a</literal></entry>
		
            <entry>Ĥ@ IDE w (<literal>ad0</literal>) WĤ@ slice 
                (<literal>s1</literal>) Ĥ@Ӥΰ (<literal>a</literal>)C
            </entry>
		  </row>

	      <row>
		    <entry><literal>da1s2e</literal></entry>
            <entry>ĤG SCSI w (<literal>da1</literal>) WĤG slice 
                (<literal>s2</literal>) ĤӤΰ (<literal>e</literal>)C
            </entry>
	      </row>
	    </tbody>
	  </tgroup>
	</informaltable>
      </example>

      <example id="basics-concept-disk-model">
	<title>ϺЪҫ</title>

	<para> FreeBSD tΪĤ@ IDE ϺоtmϡC
	  ]oӺϺЪeqO 4&nbsp;GBAåB]tF 2&nbsp;GB  slice
	  (&ms-dos; ΰ)C Ĥ@ slice O DOS  
	  <devicename>C:</devicename> ϺоAĤGӫhwˤF FreeBSDC
	  dҤ FreeBSD TӤΰϥHΤ@ swap ΰϡC</para>

	<para>oTӤΰϨCӳO@ɮרtΡC
	  <literal>a</literal> άO (root) ɮרtΡF 
	  <literal>e</literal> O <filename>/var</filename>F 
	  <literal>f</literal> άO <filename>/usr</filename> 
	  ؿcC</para>

        <mediaobject>
          <imageobject>
            <imagedata fileref="install/disk-layout" format="EPS">
          </imageobject>
 
          <textobject>
	    <literallayout class="monospaced">.-----------------.  --.
|                 |    |
|  DOS / Windows  |    |
:                 :     >  First slice, ad0s1
:                 :    |
|                 |    |
:=================:  ==:                               --.
|                 |    |  Partition a, mounted as /      |
|                 |     > referred to as ad0s2a          |
|                 |    |                                 |
:-----------------:  ==:                                 |
|                 |    |  Partition b, used as swap      |
|                 |     > referred to as ad0s2b          |
|                 |    |                                 |
:-----------------:  ==:                                 |  Partition c, no
|                 |    |  Partition e, used as /var       > file system, all 
|                 |     > referred to as ad0s2e          |  of FreeBSD slice,
|                 |    |                                 |  ad0s2c
:-----------------:  ==:                                 |
|                 |    |                                 |
:                 :    |  Partition f, used as /usr      |
:                 :     > referred to as ad0s2f          |
:                 :    |                                 |
|                 |    |                                 |
|                 |  --'                                 |
`-----------------'                                    --'</literallayout>
          </textobject>
        </mediaobject>
      </example>
  </sect1>



  <sect1 id="mount-unmount">
    <title>Pɮרt</title>

    <para>ɮרtδN@C <filename>/</filename>
      NOڡA <filename>/dev</filename>A<filename>/usr</filename>
      HΨLbڥؿUؿNOKAӳoǾKWS٦AO 
      <filename>/usr/local</filename> C</para>

    <indexterm><primary>ɮרt</primary></indexterm>
    <para> ]Yǭ]Aڭ̷|N@ǥؿObPɮרtΤWC
      p <filename>/var</filename> ]tFi|XӪ 
      <filename>log/</filename>A<filename>spool/</filename>
      ؿHΦUU˪ȦsɡC
      ɮרtζ캡XMOӦnDNAҥHڭ̩|ɦV 
      <filename>/var</filename> q <filename>/</filename> ԥXӡC</para>

    <para>t@ӱ`YǥؿbPɮרtΤWzѬOG
      oɮצbPεϺоWC
      O<link linkend="network-nfs">ɮרt</link> 
      (Network File System) άOоC</para>

    <sect2 id="disks-fstab">
      <title> <filename>fstab</filename> </title>
      <indexterm>
	<primary>ɮרt file systems</primary>
	<secondary>fstab mounted with fstab</secondary>
      </indexterm>

      <para>b <filename>/etc/fstab</filename> 
        ̭]wɮרtη|b<link linkend="boot">}</link>L{۰ʦaQ
        (DɮרtΦQ[W <option>noauto</option> Ѽ)C</para>

      <para><filename>/etc/fstab</filename> ɮפe榡pUG</para>

      <programlisting><replaceable>device</replaceable>       <replaceable>/mount-point</replaceable> <replaceable>fstype</replaceable>     <replaceable>options</replaceable>      <replaceable>dumpfreq</replaceable>     <replaceable>passno</replaceable></programlisting>

      <variablelist>
	<varlistentry>
	  <term><literal>device</literal></term>
	  <listitem>
	    <para>˸mW (Ӹ˸musb)C ԱаѾ\
	      <xref linkend="disks-naming">.</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><literal>mount-point</literal></term>
            
	  <listitem><para>ɮרtέn쪺ؿ (ӥؿusb)C</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term><literal>fstype</literal></term>
            
	  <listitem><para>ɮרtAoOnǵ &man.mount.8; ѼơC 
              FreeBSD w]ɮרtάO <literal>ufs</literal>C</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term><literal>options</literal></term>
            
	  <listitem>
          <para> iŪigɮרtΥ 
            <option>rw</option>AӰŪɮרtΫhO 
	    <option>ro</option>A᭱ݭn٥iH[LﶵC
            `ﶵp <option>noauto</option> 
            OΦbn}L{۰ʪɮרtΡC 
            LhﶵiHb &man.mount.8; ̭C</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term><literal>dumpfreq</literal></term>
          
	  <listitem>
	    <para> &man.dump.8; ѦبMwɮרtλݭnɦLC
	      pGoťիhHsw]ȡC</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term><literal>passno</literal></term>

	  <listitem>
            <para>oӶبMwɮרtˬdǡC 
	      nLˬdɮרtΡA̪ <literal>passno</literal> 
	      ȭn]sC ɮרtΪ <literal>passno</literal> ]@ 
	      (]ݭnҦL٭nˬd)AӨLɮרtΪ
	      <literal>passno</literal> ӭn]o@jC
	      YhɮרtΨ㦳ۦP <literal>passno</literal> ȡAh
	      &man.fsck.8; |յۥa(pGi઺)ˬdoɮרtΡC
            </para>
         </listitem>
	</varlistentry>
      </variablelist>

      <para>h <filename>/etc/fstab</filename> 
	ɮ׮榡οﶵTаѾ\ &man.fstab.5; C</para>
    </sect2>

    <sect2 id="disks-mount">
      <title><command>mount</command> O</title>
      <indexterm>
	<primary>ɮרt file systems</primary>
	<secondary> mounting</secondary>
      </indexterm>
        
      <para> &man.mount.8; OOӱɮרtΥΪC</para>
        
      <para>򥻪ާ@O榡pU:</para>

      <informalexample>
	<screen>&prompt.root; <userinput>mount <replaceable>device</replaceable> <replaceable>mountpoint</replaceable></userinput></screen>
      </informalexample>

      <para>b &man.mount.8; 
	̭@j諸ﶵAḺ`ΪNOoǡG</para>

      <variablelist>
	<title>ﶵ</title>

	<varlistentry>
	  <term><option>-a</option></term>
            
	  <listitem>
	    <para>  <filename>/etc/fstab</filename> 
	      ̭Ҧ٨SQBSQаO <quote>noauto</quote> 
	      ӥBS <option>-t</option> ưɮרtα_ӡC</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term><option>-d</option></term>
            
	  <listitem>
	    <para>Ҧʧ@AOuhIs system callC
	      oӿﶵM <option>-v</option> ftӱ &man.mount.8;
	      Nnʧ@ɫܦnΡC</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term><option>-f</option></term>

	  <listitem>
	    <para>jbɮרt (MI)AάOΨӱjgJv
	      (ɮרtΪAqisܦŪ)C</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
          <term><option>-r</option></term>
            
	  <listitem>
	    <para>ΰŪ覡ɮרtΡC oӿﶵMb <option>-o</option>
	      ﶵw <option>ro</option> (b &os; 5.2eO
	      <option>rdonly</option>) ѼƬO@˪C</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term><option>-t</option>
	    <replaceable>fstype</replaceable></term>

	  <listitem>
	    <para> ΫwɮרtΫA (fstype) 
	      ӱwɮרtΡAάOb <option>-a</option>
	      ﶵɥuwAɮרtΡC</para>
              
	    <para>w]ɮרtάO <quote>ufs</quote>C</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term><option>-u</option></term>
            
	  <listitem>
	    <para>sɮרtΪﶵC</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term><option>-v</option></term>
            
	  <listitem>
	    <para>ܸԲӸTC</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term><option>-w</option></term>
            
	  <listitem>
	    <para>HisҦɮרtΡC</para>
	  </listitem>
	</varlistentry>
      </variablelist>
        
      <para> <option>-o</option> 
	ﶵ᭱ۥѳrjѼƦCAҦpoǰѼơG</para>
      <variablelist>
	<varlistentry>
	  <term>nodev</term>
            
	  <listitem>
	    <para>ѪRɮרtΤWS˸mAoO@ZΪwﶵC</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term>noexec</term>
            
	  <listitem>
            <para>\boɮרtΤWGi{XAo]O@ZΪwﶵC</para>
	  </listitem>
	</varlistentry>
          
	<varlistentry>
	  <term>nosuid</term>
            
	  <listitem>
	    <para>ѪRɮרtΤW setuid  setgid XСAo]O@ZΪwﶵC</para>
	  </listitem>
	</varlistentry>
      </variablelist>
    </sect2>

    <sect2 id="disks-umount">
      <title><command>umount</command> O</title>
      <indexterm>
	<primary>ɮרt file systems</primary>
	<secondary> unmounting</secondary>
      </indexterm>
        
        <para>&man.umount.8; OѼƥiHOI 
	  (mountpoint)A˸mW١AH <option>-a</option> άO 
	  <option>-A</option> ﶵC</para>

        <para>[W <option>-f</option> iHjA[W <option>-v</option>
	  hO|ܸԲӸTC n`NO@ӻ <option>-f</option> 
          äOӦnDNAjɮרtΦi|yqάOlaɮרtΤơC</para>
        
        <para><option>-a</option> M <option>-A</option> 
          OΨӨҦwɮרtΡAt~٥iH <option>-t</option>
          ӫwnOǺɮרtΡC n`NO <option>-A</option>
	  ä|չϨɮרtΡC</para>

    </sect2>
  </sect1>

  <sect1 id="basics-processes">
    <title>{</title>

    <para>FreeBSD O@Ӧhu@~tΡA]NObP@ɶiH]WL@ӵ{C
      C@ӥbɶ]{Ns <firstterm>{ (process)</firstterm>C
      zUCӫOܤַ|}Ҥ@ӷs{ǡAӦǨtε{ǬO@b]HtΥ`B@C</para>

    <para>C@ӵ{ǳ@ӤЪƦrs <firstterm>process ID
      </firstterm>Aκ٬ <firstterm>PID
      </firstterm>AӥBNɮפ@ˡAC@ӵ{Ǥ]֦̤θsաC
        ֦̤θsժTOΨӨMwɮשθ˸mOoӵ{ǥiH}Ҫ
	(eLɮv)C j{ǳ{ǡC 
	{ǬO}ҳoӵ{Ǫ{ǡAҦpGz shell JOAshell
        NO@ӵ{ǡAӱz檺O]O{ǡC 
	C@ӱzγoؤ覡]{Ǫ{ǳO shellC
        @ӯSO{ǥs &man.init.8; OӨҥ~C <command>init</command>
	ûOĤ@ӵ{ǡAҥHL PID @|O 1C b FreeBSD }ɭ 
	<command>init</command> |۰ʦaQ kernel }ҡC</para>
        
    <para> nݨtΰ椤{ǡAӬ۷ΪOiΡG
      &man.ps.1; H &man.top.1;C<command>ps</command> 
      OOΨӦCXb椧{ǡAӥBiHq̪ 
      PIDBΤFhְOB檺OW٤ΨᤧѼƬO򵥵C
      <command>top</command> 
      OhOܩҦb檺{ǡAåBƬs@C
      ]ziHʦ[ݱzqbC</para>
    <para>bw]pUA<command>ps</command> 
      Ou|qXzҾ֦{ǡC ҦpG</para>
        
    <screen>&prompt.user; <userinput>ps</userinput>
  PID  TT  STAT      TIME COMMAND
  298  p0  Ss     0:01.10 tcsh
 7078  p0  S      2:40.88 xemacs mdoc.xsl (xemacs-21.1.14)
37393  p0  I      0:03.11 xemacs freebsd.dsl (xemacs-21.1.14)
48630  p0  S      2:50.89 /usr/local/lib/netscape-linux/navigator-linux-4.77.bi
48730  p0  IW     0:00.00 (dns helper) (navigator-linux-)
72210  p0  R+     0:00.00 ps
  390  p1  Is     0:01.14 tcsh
 7059  p2  Is+    1:36.18 /usr/local/bin/mutt -y
 6688  p3  IWs    0:00.00 tcsh
10735  p4  IWs    0:00.00 tcsh
20256  p5  IWs    0:00.00 tcsh
  262  v0  IWs    0:00.00 -tcsh (tcsh)
  270  v0  IW+    0:00.00 /bin/sh /usr/X11R6/bin/startx -- -bpp 16
  280  v0  IW+    0:00.00 xinit /home/nik/.xinitrc -- -bpp 16
  284  v0  IW     0:00.00 /bin/sh /home/nik/.xinitrc
  285  v0  S      0:38.45 /usr/X11R6/bin/sawfish</screen>

    <para>boӽdҸ̥iHݨ &man.ps.1; XnXC
      <literal>PID</literal> NOe쪺 process IDC PID tOq
      1 }l@ 99999ApGΧܤS|¶^ӭY}ltC
      <literal>TT</literal> Ooӵ{b tty 
      WAbo̥iHޡC <literal>STAT</literal> 
      O{AA]iHnޡC <literal>TIME</literal> Ooӵ{b 
      CPU W檺ɶ&mdash;
      oq`O{`@᪺ɶA]z}l{Aj{b CPU 
      We|W֮ɶݡC ̫A<literal>COMMAND</literal> 
      Ooӵ{ROCC</para>
        
    <para>&man.ps.1; 
      XӤPﶵզXiHΨܧܥXӪTA䤤@ӳ̦ΪզXO
      <literal>auxww</literal>C <option>a</option> 
      ܩҦb]{ǪOAuOzۤwC <option>u</option> 
      ܵ{Ǫ֦̦W٥HΰOϥαpC <option>x</option>
       daemon {ܥXӡA <option>ww</option>  &man.ps.1;
      ܥX㪺ROCeAӤOtXùeܥXgLA׵ŪeC
      </para>
        
    <para> &man.top.1; ]XC @몺pݹOoˡG</para>

    <screen>&prompt.user; <userinput>top</userinput>
last pid: 72257;  load averages:  0.13,  0.09,  0.03    up 0+13:38:33  22:39:10
47 processes:  1 running, 46 sleeping
CPU states: 12.6% user,  0.0% nice,  7.8% system,  0.0% interrupt, 79.7% idle
Mem: 36M Active, 5256K Inact, 13M Wired, 6312K Cache, 15M Buf, 408K Free
Swap: 256M Total, 38M Used, 217M Free, 15% Inuse

  PID USERNAME PRI NICE  SIZE    RES STATE    TIME   WCPU    CPU COMMAND
72257 nik       28   0  1960K  1044K RUN      0:00 14.86%  1.42% top
 7078 nik        2   0 15280K 10960K select   2:54  0.88%  0.88% xemacs-21.1.14
  281 nik        2   0 18636K  7112K select   5:36  0.73%  0.73% XF86_SVGA
  296 nik        2   0  3240K  1644K select   0:12  0.05%  0.05% xterm
48630 nik        2   0 29816K  9148K select   3:18  0.00%  0.00% navigator-linu
  175 root       2   0   924K   252K select   1:41  0.00%  0.00% syslogd
 7059 nik        2   0  7260K  4644K poll     1:38  0.00%  0.00% mutt
..</screen>

    <para>XTӳC}Y (e) qX̪@ӵ{Ǫ 
      PIDBtΥt (tΦh)BtΪ}ɶ 
      (qW}_) Hβ{bɶC 
      b}Y̭LƦrOObhֵ{ǥb 
      (bҤ47)BhְO swap space 
      QeΤFA٦NOtΤOFh֮ɶbP CPU AWC</para>

    <para>UӪOѦnXҺcAM &man.ps.1; XTC
      NpPeҡAziHݨ PIDBϥΪ̦W١BCPU 
      OɶHΥb檺OC &man.top.1; 
      bw]pUٷ|iDz{ǥαFh֪OŶC
      bo|A@ӬO`ζq (total size)At@ӬOڥζq
      (resident size)&mdash;`ζqOoε{ݭnOŶAӹڥζqhOڤWӵ{OϥζqC
      boӨҤḽziHݨ <application>&netscape;</application> 
      nFXG 30 MB  RAMAOuΨ 9 MBC</para>
    
    <para>&man.top.1; Cj 2 |۰ʧsܤeAi <option>s</option> 
      ﶵӧܶjɶC</para>
    
  </sect1>

  <sect1 id="basics-daemons">
    <title>DaemonBHβפ{</title>

    <para>bѽs边ɭԡAziHΫ²檺覡ާ@AnŪɮשάO򪺡C
      iHo˰O]s边ѳoǥ\A٦NOs边̪b@<firstterm>׺ݾ (Terminal)
      </firstterm>WC
      ǵ{äO]p@bϥΪ̪JAҥH̦b@}l檺ɭԴNq׺ݾ_}FC
      ҦpAAѳb^譱nDAq`ݭnzJFC
      t~OHq@ӯǰet@ӯ{]Ooε{C</para>
        
    <para>ڭ̧oص{٧@ <firstterm>daemon</firstterm>C 
      Daemon (c]Bu@) 
      OþܤAL̤ݩ󵽨}}Ψc}AOu@pFC
      jPWӻL̴NObH@ǦΪƱA򤵤ѪAάOlAܹC
      o]NO BSD 
      NHӳO@ۦ|cۤTeҪּ֤pc]
      (ĶGߺDΪkANݩ󨸴c}) ]C</para>

    <para>q`ӻ deamon {Wr᭱|[@Ӧr <quote>d</quote>C
      <application>BIND</application> O Berkeley Internet Name Daemon 
      Yg (q`ڤW檺{W٬O <command>named</command>)BApache
      A{W٬Os 
      <command>httpd</command>BLAȵ{եs 
      <command>lpd</command>A̦C 
      oO@زߺDΪkASwʳWwAҦp <application>Sendmail</application>
      DnHH daemon Os <command>sendmail</command> ӤO 
      <command>maild</command>AzQ@ˡC</para>

    <para>bǮɭԱz|JݭnY daemon {ǷqpC
      oǷqO<firstterm>H (signal) </firstterm>ӹFC
      ǥѰeXHAziHM@ daemon (άO@ӥb]{) qC
      Hܦh&mdash;ǦSwNqAǫhO|ε{ӸŪC
      ε{|iDzӵ{OpŪHC
      zueHz֦{ǡAe &man.kill.1;  &man.kill.2;
      HOH{ǬOQ\C L <username> root </username>
      ALiHeHH{ǡC</para>

    <para>FreeBSD bYǱp]|eHε{C
      ]ε{goAMϭnsӸIO骺ɭԡAFreeBSD
      |e@ <firstterm>Segmentation Violation</firstterm> H 
      (<literal>SIGSEGV</literal>) oӵ{ǡC 
      SpG@ε{ΤF &man.alarm.3;  system call 
      nDtΦbL@qɶsL@UAɶFɭԾxH
      (<literal>SIGALRM</literal>) N|QeXFAL̦C</para>

    <para><literal>SIGTERM</literal> and <literal>SIGKILL</literal> 
      oӫHiHӲפ{ǡC  <literal>SIGTERM</literal> 
      {ǬO§覡Aӵ{Ƿ|<emphasis> (catch) </emphasis>
      oӫHӤFѨzQnLC
      ۤUӥ|⥦ۤw}OɳqqAMb{Ǥe䪺u@C
      bYǱpU{Ǧi|˧@Sݨ
      <literal>SIGTERM</literal>Apb@Ǥत_u@ܡC</para>
    <para><literal>SIGKILL</literal> NSkQ{ǩFC
      oO@<quote>ںާAbFA{bNڰU</quote>HC
      pGzeF <literal>SIGKILL</literal> HYӵ{ǡAFreeBSD
      N|⥦<footnote>
    <para> T&mdash;٬OּƪF褣Q_C
      Ҧpӵ{ǥbqWOqŪ@ɮסAӨq]Yǲzѳs
      (QAάO걼F)Aoӵ{ǧڭ̴NLO@<quote>त_</quote>{ǡC
      q`bgLkoӵ{Ƿ|OɡC 
      o͹OɪɭԳoӵ{ǴN|QFC</para>
  </footnote>C</para>
    
    <para> oǬOLzi|nΨ쪺HG 
      <literal>SIGHUP</literal>A<literal>SIGUSR1</literal>AH
      <literal>SIGUSR2</literal>C
      oǬOqΪHAeXɤPε{|PC</para>
      
    <para>]zʤFzA]w&mdash;zQnsAhsŪ]wȡC
      ziHAsҰ
      <command>httpd</command>AOo򰵷|yAȰAȤ@qɶAoˤliणӦnC
      j daemon g|h^ <literal>SIGHUP</literal>C
      oӫHA̷|hsŪۤw]wɡC
      ]ziHΰe <literal>SIGHUP</literal> HӨN}C
      S]SзǦbWdp^oǫHAP daemon 
      i|P欰AҥHðݪܽХT{½\ deamon C</para>
    
    <para>HO &man.kill.1; OeXApdҩҥܡG</para>
    
    <procedure>
      <title>eH{</title>

      <para>oӽdұN|ܽdpe@ӫH &man.inetd.8;C
        <command>inetd</command> ]wɬO
        <filename>/etc/inetd.conf</filename>A <command>inetd</command>
        |b <literal>SIGHUP</literal> ɭԭsŪoӳ]wɡC</para>

      <step>
    <para>XzQneHӵ{Ǫ IDC z|Ψ &man.ps.1; H &man.grep.1; 
      oӫOC &man.grep.1; OΨӦbXjMAXzwrC
      oӫOOѤ@ϥΪ̰A &man.inetd.8; O <username>root</username>
      AҥHbϥ &man.ps.1; ɻݭn[W <option>ax</option> ﶵC </para>

	<screen>&prompt.user; <userinput>ps -ax | grep inetd</userinput>
  198  ??  IWs    0:00.00 inetd -wW</screen>

    <para>]io &man.inetd.8;  PID  198C bYǱpU
      <literal>grep inetd</literal> oӫO]|X{bX̡C
      oO] &man.ps.1; 椤{Ǫ覡yC </para>
      </step>

      <step>
    <para> &man.kill.1; ӰeHC S] &man.inetd.8; O 
      <username>root</username> 檺Az &man.su.1; 
      <username>root</username>C</para>

	<screen>&prompt.user; <userinput>su</userinput>
<prompt>Password:</prompt>
&prompt.root; <userinput>/bin/kill -s HUP 198</userinput></screen>

    <para>@뱡pjh &unix; OA &man.kill.1; 
      榨\ɨä|XTC
      ]ze@ӫHYӤOzҾ֦{ǡAzN|Yoӿ~TG
      <errorname>kill: <replaceable>PID</replaceable>: Operation not
        permitted</errorname>C ӦpGz PID ܡA
      N|He~{ǡC
      i|VALpGzBܡAinNuOHe@ӫDϥΤ
      PIDAzNu|ݨ <errorname>kill:
        <replaceable>PID</replaceable>: No such process</errorname>
      ӤwC</para>

	<note>
      <title> <command>/bin/kill</command>H</title>
      
      <para>ܦh shell Ѥت <command>kill</command> OC
        ]NOo shell |eHAӤO
        <filename>/bin/kill</filename>C
        oˬOZKSաAOP shell |PykӫwHWٵC
        Pեh⥦̳qqǷ|ApNª <command>/bin/kill 
        <replaceable>...</replaceable></command> aC</para>
	</note>
      </step>
    </procedure>

    <para>neLHܤ]OD`ANݭnO 
      <literal>TERM</literal>  <literal>KILL</literal> 
      YiC</para>
    
    <important>
      <para>HK@ӨtΤ{ǵML屼äOӦnDNC 
        SOO &man.init.8;A process ID 1A@ӫD`SO{ǡC
         <command>/bin/kill -s KILL 1</command> 
        GNOtΥߨC ]bzU <keycap>Return</keycap> 
        n &man.kill.1;<emphasis>e</emphasis>A
        <emphasis>@w</emphasis>nOoAT{zUѼơC</para>
    </important>
  </sect1>

  <sect1 id="shells">
    <title>Shells</title>
    <indexterm><primary>shells</primary></indexterm>
    <indexterm><primary>command line</primary></indexterm>

    <para>In FreeBSD, a lot of everyday work is done in a command line
      interface called a shell.  A shell's main job is to take commands
      from the input channel and execute them.  A lot of shells also have
      built in functions to help everyday tasks such as file management,
      file globbing, command line editing, command macros, and environment
      variables.  FreeBSD comes with a set of shells, such as 
      <command>sh</command>, the Bourne Shell, and <command>tcsh</command>, 
      the improved C-shell.  Many other shells are available
      from the FreeBSD Ports Collection, such as
      <command>zsh</command> and <command>bash</command>.</para>

    <para>Which shell do you use?  It is really a matter of taste.  If you
      are a C programmer you might feel more comfortable with a C-like shell
      such as <command>tcsh</command>.  If you have come from Linux or are new 
      to a &unix; command line interface you might try <command>bash</command>.  
      The point is that each
      shell has unique properties that may or may not work with your
      preferred working environment, and that you have a choice of what
      shell to use.</para>

    <para>One common feature in a shell is filename completion.  Given
      the typing of the first few letters of a command or filename, you
      can usually have the shell automatically complete the rest of the
      command or filename by hitting the <keycap>Tab</keycap> key on the keyboard.  Here is
      an example.  Suppose you have two files called
      <filename>foobar</filename> and <filename>foo.bar</filename>.  You
      want to delete <filename>foo.bar</filename>.  So what you would type
      on the keyboard is: <command>rm fo[<keycap>Tab</keycap>].[<keycap>Tab</keycap>]</command>.</para>

    <para>The shell would print out <command>rm
      foo[BEEP].bar</command>.</para>

    <para>The [BEEP] is the console bell, which is the shell telling me it
      was unable to totally complete the filename because there is more
      than one match.  Both <filename>foobar</filename> and
      <filename>foo.bar</filename> start with <literal>fo</literal>, but
      it was able to complete to <literal>foo</literal>.  If you type in
      <literal>.</literal>, then hit <keycap>Tab</keycap> again, the shell would be able to
      fill in the rest of the filename for you.</para>
    <indexterm><primary>environment variables</primary></indexterm>

    <para>Another feature of the shell is the use of environment variables.
      Environment variables are a variable key pair stored in the shell's
      environment space.  This space can be read by any program invoked by
      the shell, and thus contains a lot of program configuration.  Here
      is a list of common environment variables and what they mean:</para>
    <indexterm><primary>environment variables</primary></indexterm>

    <informaltable frame="none" pgwide="1">
      <tgroup cols="2">
	<thead>
	  <row>
	    <entry>Variable</entry>
	    <entry>Description</entry>
	  </row>
	</thead>

	<tbody>
	  <row>
	    <entry><envar>USER</envar></entry>
	    <entry>Current logged in user's name.</entry>
	  </row>

	  <row>
	    <entry><envar>PATH</envar></entry>
	    <entry>Colon separated list of directories to search for
	      binaries.</entry>
	  </row>

	  <row>
	    <entry><envar>DISPLAY</envar></entry>
	    <entry>Network name of the X11 display to connect to, if
	      available.</entry>
	  </row>

	  <row>
	    <entry><envar>SHELL</envar></entry>
	    <entry>The current shell.</entry>
	  </row>

	  <row>
	    <entry><envar>TERM</envar></entry>
	    <entry>The name of the user's terminal.  Used to determine the
	      capabilities of the terminal.</entry>
	  </row>

	  <row>
	    <entry><envar>TERMCAP</envar></entry>
	    <entry>Database entry of the terminal escape codes to perform
	      various terminal functions.</entry>
	  </row>

	  <row>
	    <entry><envar>OSTYPE</envar></entry>
	    <entry>Type of operating system.  e.g., FreeBSD.</entry>
	  </row>

	  <row>
	    <entry><envar>MACHTYPE</envar></entry>
	    <entry>The CPU architecture that the system is running
	      on.</entry>
	  </row>

	  <row>
	    <entry><envar>EDITOR</envar></entry>
	    <entry>The user's preferred text editor.</entry>
	  </row>

	  <row>
	    <entry><envar>PAGER</envar></entry>
	    <entry>The user's preferred text pager.</entry>
	  </row>

	  <row>
	    <entry><envar>MANPATH</envar></entry>
	    <entry>Colon separated list of directories to search for
	      manual pages.</entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>

    <indexterm><primary>Bourne shells</primary></indexterm>
    <para>Setting an environment variable differs somewhat from
      shell to shell.  For example, in the C-Style shells such as
      <command>tcsh</command> and <command>csh</command>, you would use
      <command>setenv</command> to set environment variables.
      Under Bourne shells such as <command>sh</command> and
      <command>bash</command>, you would use
      <command>export</command> to set your current environment
      variables.  For example, to set or modify the
      <envar>EDITOR</envar> environment variable, under <command>csh</command> or 
      <command>tcsh</command> a
      command like this would set <envar>EDITOR</envar> to
      <filename>/usr/local/bin/emacs</filename>:</para>

    <screen>&prompt.user; <userinput>setenv EDITOR /usr/local/bin/emacs</userinput></screen>

    <para>Under Bourne shells:</para>

    <screen>&prompt.user; <userinput>export EDITOR="/usr/local/bin/emacs"</userinput></screen>

    <para>You can also make most shells expand the environment variable by
      placing a <literal>$</literal> character in front of it on the
      command line.  For example, <command>echo $TERM</command> would
      print out whatever <envar>$TERM</envar> is set to, because the shell
      expands <envar>$TERM</envar> and passes it on to <command>echo</command>.</para>

    <para>Shells treat a lot of special characters, called meta-characters
      as special representations of data.  The most common one is the
      <literal>*</literal> character, which represents any number of
      characters in a filename.  These special meta-characters can be used
      to do filename globbing.  For example, typing in
      <command>echo *</command> is almost the same as typing in
      <command>ls</command> because the shell takes all the files that
      match <literal>*</literal> and puts them on the command line for
      <command>echo</command> to see.</para>

    <para>To prevent the shell from interpreting these special characters,
      they can be escaped from the shell by putting a backslash
      (<literal>\</literal>) character in front of them.  <command>echo
      $TERM</command> prints whatever your terminal is set to.
      <command>echo \$TERM</command> prints <envar>$TERM</envar> as
      is.</para>

    <sect2 id="changing-shells">
      <title>Changing Your Shell</title>

      <para>The easiest way to change your shell is to use the
	<command>chsh</command> command.  Running <command>chsh</command> will
	place you into the editor that is in your <envar>EDITOR</envar>
	environment variable; if it is not set, you will be placed in
	<command>vi</command>.  Change the <quote>Shell:</quote> line
	accordingly.</para>

      <para>You can also give <command>chsh</command> the
	<option>-s</option> option; this will set your shell for you,
	without requiring you to enter an editor.  
	For example, if you wanted to
	change your shell to <command>bash</command>, the following should do the
	trick:</para>
	
      <screen>&prompt.user; <userinput>chsh -s /usr/local/bin/bash</userinput></screen>

      <note>
	<para>The shell that you wish to use <emphasis>must</emphasis> be
	  present in the <filename>/etc/shells</filename> file.  If you
	  have installed a shell from the <link linkend="ports">ports
	  collection</link>, then this should have been done for you
	  already.  If you installed the shell by hand, you must do
	  this.</para>
     
      <para>For example, if you installed <command>bash</command> by hand
	and placed it into <filename>/usr/local/bin</filename>, you would
	want to:</para>

      <screen>&prompt.root; <userinput>echo &quot;/usr/local/bin/bash&quot; &gt;&gt; /etc/shells</userinput></screen>

       <para>Then rerun <command>chsh</command>.</para>
     </note>
   </sect2>
  </sect1>

  <sect1 id="editors">
    <title>rs边</title>
    <indexterm><primary>text editors</primary></indexterm>
    <indexterm><primary>editors</primary></indexterm>

    <para>A lot of configuration in FreeBSD is done by editing text files.
      Because of this, it would be a good idea to become familiar
      with a text editor.  FreeBSD comes with a few as part of the base
      system, and many more are available in the Ports Collection.</para>

    <indexterm>
      <primary><command>ee</command></primary>
    </indexterm>
    <indexterm>
      <primary>editors</primary>
      <secondary><command>ee</command></secondary>
    </indexterm>
    <para>The easiest and simplest editor to learn is an editor called
      <application>ee</application>, which stands for easy editor.  To
      start <application>ee</application>, one would type at the command
      line <command>ee <replaceable>filename</replaceable></command> where
      <replaceable>filename</replaceable> is the name of the file to be edited.
      For example, to edit <filename>/etc/rc.conf</filename>, type in
      <command>ee /etc/rc.conf</command>.  Once inside of 
      <command>ee</command>, all of the
      commands for manipulating the editor's functions are listed at the
      top of the display. The caret <literal>^</literal> character represents
      the <keycap>Ctrl</keycap> key on the keyboard, so <literal>^e</literal> expands to the key combination
      <keycombo action="simul"><keycap>Ctrl</keycap><keycap>e</keycap></keycombo>.  To leave
      <application>ee</application>, hit the <keycap>Esc</keycap> key, then choose leave
      editor.  The editor will prompt you to save any changes if the file
      has been modified.</para>

    <indexterm>
      <primary><command>vi</command></primary>
    </indexterm>
    <indexterm>
      <primary>editors</primary>
      <secondary><command>vi</command></secondary>
    </indexterm>
    <indexterm>
      <primary><command>emacs</command></primary>
    </indexterm>
    <indexterm>
      <primary>editors</primary>
      <secondary><command>emacs</command></secondary>
    </indexterm>
    <para>FreeBSD also comes with more powerful text editors such as
      <application>vi</application> as part of the base system, while other editors, like
      <application>Emacs</application> and <application>vim</application>,
      are part of the FreeBSD Ports Collection (<filename role="package">editors/emacs</filename> and <filename role="package">editors/vim</filename>).  These editors offer much
      more functionality and power at the expense of being a little more
      complicated to learn.  However if you plan on doing a lot of text
      editing, learning a more powerful editor such as
      <application>vim</application> or <application>Emacs</application>
      will save you much more time in the long run.</para>
  </sect1>

  <sect1 id="basics-devices">
    <title>Devices and Device Nodes</title>

    <para>A device is a term used mostly for hardware-related
      activities in a system, including disks, printers, graphics
      cards, and keyboards.  When FreeBSD boots, the majority
      of what FreeBSD displays are devices being detected.
      You can look through the boot messages again by viewing
      <filename>/var/run/dmesg.boot</filename>.</para>

    <para>For example, <devicename>acd0</devicename> is the
      first IDE CDROM drive, while <devicename>kbd0</devicename>
      represents the keyboard.</para>

    <para>Most of these devices in a &unix; operating system must be
      accessed through special files called device nodes, which are
      located in the <filename>/dev</filename> directory.</para>

    <sect2>
      <title>Creating Device Nodes</title>
      <para>When adding a new device to your system, or compiling
	in support for additional devices, you may need to create one or
	more device nodes for the new devices.</para>

      <sect3>
	<title>MAKEDEV Script</title>
	<para>On systems without <literal>DEVFS</literal> (this concerns all FreeBSD versions before 5.0), device nodes are created
	  using the &man.MAKEDEV.8; script as shown below:</para>

	<screen>&prompt.root; <userinput>cd /dev</userinput>
&prompt.root; <userinput>sh MAKEDEV ad1</userinput>
	</screen>

	<para>This example would make the proper device nodes
	  for the second IDE drive when installed.</para>
      </sect3>

      <sect3>
	<title><literal>DEVFS</literal> (DEVice File System)</title>

	<para> The device file system, or <literal>DEVFS</literal>, provides access to
	  kernel's device namespace in the global file system namespace.
	  Instead of having to create and modify device nodes,
	  <literal>DEVFS</literal> maintains this particular file system for you.</para>

	<para>See the &man.devfs.5; manual page for more
	  information.</para>

	<para><literal>DEVFS</literal> is used by default in FreeBSD&nbsp;5.0 and above.</para>
      </sect3>
    </sect2>
  </sect1>

  <sect1 id="binary-formats">
    <title>Binary Formats</title>

    <para>To understand why &os; uses the &man.elf.5;
      format, you must first know a little about the three currently
      <quote>dominant</quote> executable formats for &unix;:</para>

    <itemizedlist>
      <listitem>
        <para>&man.a.out.5;</para>

        <para>The oldest and <quote>classic</quote> &unix; object
          format.  It uses a short and compact header with a magic
          number at the beginning that is often used to characterize
          the format (see &man.a.out.5; for more details).  It
          contains three loaded segments: .text, .data, and .bss plus
          a symbol table and a string table.</para>
      </listitem>

      <listitem>
        <para><acronym>COFF</acronym></para>

        <para>The SVR3 object format.  The header now comprises a
          section table, so you can have more than just .text, .data,
          and .bss sections.</para>
      </listitem>

      <listitem>
        <para>&man.elf.5;</para>

        <para>The successor to <acronym>COFF</acronym>, featuring
          multiple sections and 32-bit or 64-bit possible values.  One
          major drawback: <acronym>ELF</acronym> was also designed
          with the assumption that there would be only one ABI per
          system architecture.  That assumption is actually quite
          incorrect, and not even in the commercial SYSV world (which
          has at least three ABIs: SVR4, Solaris, SCO) does it hold
          true.</para>

        <para>FreeBSD tries to work around this problem somewhat by
          providing a utility for <emphasis>branding</emphasis> a
          known <acronym>ELF</acronym> executable with information
          about the ABI it is compliant with.  See the manual page for
          &man.brandelf.1; for more information.</para>
      </listitem>
    </itemizedlist>

    <para>FreeBSD comes from the <quote>classic</quote> camp and used
      the &man.a.out.5; format, a technology tried and proven through
      many generations of BSD releases, until the beginning of the 3.X
      branch. Though it was possible to build and run native
      <acronym>ELF</acronym> binaries (and kernels) on a FreeBSD
      system for some time before that, FreeBSD initially resisted the
      <quote>push</quote> to switch to <acronym>ELF</acronym> as the
      default format. Why?  Well, when the Linux camp made their
      painful transition to <acronym>ELF</acronym>, it was not so much
      to flee the <filename>a.out</filename> executable format as it
      was their inflexible jump-table based shared library mechanism,
      which made the construction of shared libraries very difficult
      for vendors and developers alike. Since the
      <acronym>ELF</acronym> tools available offered a solution to the
      shared library problem and were generally seen as <quote>the way
      forward</quote> anyway, the migration cost was accepted as
      necessary and the transition made.  FreeBSD's shared library
      mechanism is based more closely on Sun's
      &sunos; style shared library mechanism
      and, as such, is very easy to use.</para>

    <para>So, why are there so many different formats?</para>

    <para>Back in the dim, dark past, there was simple hardware.  This
      simple hardware supported a simple, small system. <filename>a.out</filename> was
      completely adequate for the job of representing binaries on this
      simple system (a PDP-11). As people ported &unix; from this simple
      system, they retained the <filename>a.out</filename> format because it was sufficient
      for the early ports of &unix; to architectures like the Motorola
      68k, VAXen, etc.</para>

    <para>Then some bright hardware engineer decided that if he could
      force software to do some sleazy tricks, then he would be able
      to shave a few gates off the design and allow his CPU core to
      run faster. While it was made to work with this new kind of
      hardware (known these days as <acronym>RISC</acronym>), <filename>a.out</filename>
      was ill-suited for this hardware, so many formats were developed
      to get to a better performance from this hardware than the
      limited, simple <filename>a.out</filename> format could
      offer. Things like <acronym>COFF</acronym>,
      <acronym>ECOFF</acronym>, and a few obscure others were invented
      and their limitations explored before things seemed to settle on
      <acronym>ELF</acronym>.</para>

    <para>In addition, program sizes were getting huge and disks (and
      physical memory) were still relatively small so the concept of a
      shared library was born. The VM system also became more
      sophisticated. While each one of these advancements was done
      using the <filename>a.out</filename> format, its usefulness was
      stretched more and more with each new feature.  In addition,
      people wanted to dynamically load things at run time, or to junk
      parts of their program after the init code had run to save in
      core memory and swap space. Languages became more sophisticated
      and people wanted code called before main automatically. Lots of
      hacks were done to the <filename>a.out</filename> format to
      allow all of these things to happen, and they basically worked
      for a time. In time, <filename>a.out</filename> was not up to
      handling all these problems without an ever increasing overhead
      in code and complexity. While <acronym>ELF</acronym> solved many
      of these problems, it would be painful to switch from the system
      that basically worked. So <acronym>ELF</acronym> had to wait
      until it was more painful to remain with
      <filename>a.out</filename> than it was to migrate to
      <acronym>ELF</acronym>.</para>

    <para>However, as time passed, the build tools that FreeBSD
      derived their build tools from (the assembler and loader
      especially) evolved in two parallel trees. The FreeBSD tree
      added shared libraries and fixed some bugs. The GNU folks that
      originally wrote these programs rewrote them and added simpler
      support for building cross compilers, plugging in different
      formats at will, and so on. Since many people wanted to build cross
      compilers targeting FreeBSD, they were out of luck since the
      older sources that FreeBSD had for <application>as</application> and <application>ld</application> were not up to the
      task. The new GNU tools chain (<application>binutils</application>) does support cross
      compiling, <acronym>ELF</acronym>, shared libraries, C++
      extensions, etc. In addition, many vendors are releasing
      <acronym>ELF</acronym> binaries, and it is a good thing for
      FreeBSD to run them.</para>

    <para><acronym>ELF</acronym> is more expressive than <filename>a.out</filename> and
      allows more extensibility in the base system. The
      <acronym>ELF</acronym> tools are better maintained, and offer
      cross compilation support, which is important to many people.
      <acronym>ELF</acronym> may be a little slower than <filename>a.out</filename>, but
      trying to measure it can be difficult. There are also numerous
      details that are different between the two in how they map
      pages, handle init code, etc. None of these are very important,
      but they are differences. In time support for
      <filename>a.out</filename> will be moved out of the <filename>GENERIC</filename>
      kernel, and eventually removed from the kernel once the need to
      run legacy <filename>a.out</filename> programs is past.</para>
  </sect1>

  <sect1 id="basics-more-information">
    <title>hT</title>

    <sect2 id="basics-man">
      <title>Manual Pages</title>
      <indexterm><primary>manual pages</primary></indexterm>

      <para>The most comprehensive documentation on FreeBSD is in the form
	of manual pages. Nearly every program on the system comes with a
	short reference manual explaining the basic operation and various
	arguments. These manuals can be viewed with the <command>man</command> command.  Use
	of the <command>man</command> command is simple:</para>

      <screen>&prompt.user; <userinput>man <replaceable>command</replaceable></userinput></screen>

      <para><literal>command</literal> is the name of the command you
        wish to learn about.  For example, to learn more about
	<command>ls</command> command type:</para>

      <screen>&prompt.user; <userinput>man ls</userinput></screen>

      <para>The online manual is divided up into numbered sections:</para>

      <orderedlist>
	<listitem>
	  <para>User commands.</para>
	</listitem>

	<listitem>
	  <para>System calls and error numbers.</para>
	</listitem>

	<listitem>
	  <para>Functions in the C libraries.</para>
	</listitem>

	<listitem>
	  <para>Device drivers.</para>
	</listitem>

	<listitem>
	  <para>File formats.</para>
	</listitem>

	<listitem>
	  <para>Games and other diversions.</para>
	</listitem>

	<listitem>
	  <para>Miscellaneous information.</para>
	</listitem>

	<listitem>
	  <para>System maintenance and operation commands.</para>
	</listitem>

	<listitem>
	  <para>Kernel developers.</para>
	</listitem>
      </orderedlist>

      <para>In some cases, the same topic may appear in more than one
	section of the online manual.  For example, there is a
	<command>chmod</command> user command and a
	<function>chmod()</function> system call.  In this case, you can
	tell the <command>man</command> command which one you want by specifying the
	section:</para>

      <screen>&prompt.user; <userinput>man 1 chmod</userinput></screen>

      <para>This will display the manual page for the user command
        <command>chmod</command>. References to a particular section of
	the online manual are traditionally placed in parenthesis in
	written documentation, so &man.chmod.1; refers to the
	<command>chmod</command> user command and &man.chmod.2; refers to
	the system call.</para>

      <para>This is fine if you know the name of the command and simply
	wish to know how to use it, but what if you cannot recall the
	command name?  You can use <command>man</command> to search for keywords in the
	command descriptions by using the <option>-k</option>
	switch:</para>

      <screen>&prompt.user; <userinput>man -k mail</userinput></screen>

      <para>With this command you will be presented with a list of
        commands that have the keyword <quote>mail</quote> in their
	descriptions.  This is actually functionally equivalent to using
	the <command>apropos</command> command.</para>

      <para>So, you are looking at all those fancy commands in
	<filename>/usr/bin</filename> but do not have the faintest idea
	what most of them actually do?  Simply do:</para>

	<screen>&prompt.user; <userinput>cd /usr/bin</userinput>
&prompt.user; <userinput>man -f *</userinput></screen>

	<para>or</para>

	<screen>&prompt.user; <userinput>cd /usr/bin</userinput>
&prompt.user; <userinput>whatis *</userinput></screen>

	<para>which does the same thing.</para>
    </sect2>

    <sect2 id="basics-info">
      <title>GNU Info Files</title>
      <indexterm><primary>Free Software Foundation</primary></indexterm>

      <para>FreeBSD includes many applications and utilities produced by
	the Free Software Foundation (FSF).  In addition to manual pages,
	these programs come with more extensive hypertext documents called
	<literal>info</literal> files which can be viewed with the
	<command>info</command> command or, if you installed
	<application>emacs</application>, the info mode of
	<application>emacs</application>.</para>

      <para>To use the &man.info.1; command, simply type:</para>

      <screen>&prompt.user; <userinput>info</userinput></screen>

      <para>For a brief introduction, type <literal>h</literal>.  For a
	quick command reference, type <literal>?</literal>.</para>
    </sect2>
  </sect1>
</chapter>
<!-- 
     Local Variables:
     mode: sgml
     sgml-declaration: "../chapter.decl"
     sgml-indent-data: t
     sgml-omittag: nil
     sgml-always-quote-attributes: t
     sgml-parent-document: ("../book.sgml" "part" "chapter")
     End:
-->


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->chinsan 
Responsible-Changed-By: chinsan 
Responsible-Changed-When: Wed Sep 5 14:58:52 UTC 2007 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116117 
State-Changed-From-To: open->closed 
State-Changed-By: chinsan 
State-Changed-When: Sun Sep 16 08:24:50 UTC 2007 
State-Changed-Why:  
Committed.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116117 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/116117: commit references a PR
Date: Sun, 16 Sep 2007 08:23:38 +0000 (UTC)

 chinsan     2007-09-16 08:23:32 UTC
 
   FreeBSD doc repository
 
   Modified files:
     zh_TW.Big5/books/handbook/basics chapter.sgml 
   Log:
   - MFen: 1.142 -> 1.149
   - More translation.
   
   PR:             docs/116117
   Obtained from:  The FreeBSD Traditional Chinese Project
   Submitted by:   whsyu
   
   Revision  Changes    Path
   1.4       +847 -990  doc/zh_TW.Big5/books/handbook/basics/chapter.sgml
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
