docs/116117: update handbook/basics translation of traditional chinese
Wei-Hao Syu
whsyu at ntu.edu.tw
Wed Sep 5 11:20:16 UTC 2007
>Number: 116117
>Category: docs
>Synopsis: update handbook/basics translation of traditional chinese
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Wed Sep 05 11:20:14 GMT 2007
>Closed-Date:
>Last-Modified:
>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 at 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
¤j³¡¥÷ªº¤º®e¦b &unix;-like §@·~¨t²Î¤¤³£¬O¬Û³qªº¡C
¦pªG±z¹ï³o¨Ç¤º®e¼ô±xªº¸Ü¡A¥i¥H©ñ¤ßªº¸õ¹L¡C
¦pªG±z豵IJ FreeBSD ¡A¨º±z¤@©wn¥J²ÓªºÅª§¹³o³¹¡C</para>
<para>Ū§¹³o¤@³¹¡A±z±N·|¤F¸Ñ:</para>
<itemizedlist>
<listitem>
<para>¦p¦ó¨Ï¥Î FreeBSD ªº<quote>virtual consoles</quote>¡C</para>
</listitem>
<listitem>
<para>&unix; ÀÉ®×Åv¹B§@ªº¤è¦¡¥H¤Î &os; ¤¤Àɮתº flags¡C</para>
</listitem>
<listitem>
<para>¹w³]ªº &os; Àɮרt²Î°t¸m¡C</para>
</listitem>
<listitem>
<para>&os; ªººÏºÐµ²ºc¡C</para>
</listitem>
<listitem>
<para>¦p¦ó±¾¸ü(mount)¡B¨ø¸ü(umount)Àɮרt²Î</para>
</listitem>
<listitem>
<para>¤°»ò¬Oprocesses¡Bdaemons ¥H¤Î signals ¡C</para>
</listitem>
<listitem>
<para>¤°»ò¬O shell ¡A¥H¤Î¦p¦óÅܧó±z¹w³]ªºµn¤JÀô¹Ò¡C</para>
</listitem>
<listitem>
<para>¦p¦ó¨Ï¥Î°ò¥»ªº¤å¦r½s¿è¾¹¡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 ¥HÀò±o§ó¦hªº¸ê°T¡C</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="consoles">
<title>Virtual Consoles ©M²×ºÝ¾÷</title>
<indexterm><primary>virtual consoles</primary></indexterm>
<indexterm><primary>terminals</primary></indexterm>
<para> ¦³«Ü¦h¤èªk¥i¥H¾Þ§@ FreeBSD ¡A¨ä¤¤¤@ºØ´N¬O¦b¤å¦r²×ºÝ¾÷¤W¥´¦r¡C
¦p¦¹¨Ï¥Î FreeBSD §Y¥i»´©öªºÅé·|¨ì &unix; §@·~¨t²Îªº«Â¤O©M¼u©Ê¡C
³o¤@¸`´yz¤°»ò¬O<quote>²×ºÝ¾÷</quote>©M
<quote>console</quote>¡A¥H¤Î¥i¥H¦p¦ó¦b FreeBSD ¤¤¹B¥Î¥¦Ì¡C</para>
<sect2 id="consoles-intro">
<title>The Console</title>
<indexterm><primary>console</primary></indexterm>
<para>¦pªG±z¨S¦³±N FreeBSD ³]©w¦¨¶}¾÷®É¦Û°Ê¶i¤J¹Ï§Î¤Æ¼Ò¦¡¡A¨t²Î·|¦b±Ò°Êªº
script ¶]§¹¤§«áÅã¥Üµn¤Jªº´£¥Ü²Å¸¹¡C ±z±N·|¬Ý¨ì¹³¬O³o¼ËªºªF¦è¡G</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Ó°T®§¦b±zªº¨t²Î¤W·|¦³¨Ç³\ªº¤£¦P¡A¦ý¬OÀ³¸Ó·|¬Ý¨ìÃþ¦üªºªF¦è¡C
§ÚÌ·P¿³½ìªº¬O³Ì«á¨â¦æ¡A³Ì«á¨â¦æ¬O¡G</para>
<programlisting>FreeBSD/i386 (pc3.example.org) (ttyv0)</programlisting>
<para>³o¦æ¥]§t¤Fè¶}¾÷§¹¨t²Îªº¸ê°T¡C ±z¬Ý¨ìªº¬O¦b Intel ©Î¬Û®e³B²z¾¹ªº
x86 ¬[ºc¤W°õ¦æªº <quote>FreeBSD</quote>ªº console<footnote>
<para>³o´N¬O <literal>i386</literal> ªº·N¸q¡C ª`·N§Y¨Ï±z¤£¬O¦b
Intel ªº 386 ³B²z¾¹¤W°õ¦æ FreeBSD ¡A¤@¼Ë¬O<literal>i386</literal>¡C
³o¤£¬O«ü§Aªº³B²z¾¹ªº«¬¸¹¡A³o¸ÌÅã¥Üªº¬O§A³B²z¾¹ªº<quote>¬[ºc</quote>
</para>
</footnote>¡C ³o¥x¾÷¾¹ªº¦W¦r (¨C¥x &unix; ¾÷¾¹³£¦³¤@Ó¦W¦r) ¬O
<hostid>pc3.example.org</hostid>¡A¦Ó±z²{¦b¬Ý¨ìªº¬O¥¦ªº¨t²Î
console— <devicename>ttyv0</devicename>²×ºÝ¾÷¡C</para>
<para>³Ì«áªº¤@¦æÀ³¸Ó³£·|¬O¡G</para>
<programlisting>login:</programlisting>
<para>³o¬O±zÀ³¸Ón¿é¤J±zªº<quote>±b¸¹¦WºÙ</quote>ªº¦a¤è¡C
¤U¤@¤p¸`±N§i¶D±z¦p¦óµn¤J FreeBSD¡C</para>
</sect2>
<sect2 id="consoles-login">
<title>µn¤J FreeBSD</title>
<para>FreeBSD ¬O¤@Ó multiuser¡Bmultiprocessing ªº¨t²Î¡C
³o¬O¤@Ó¥¿¦¡ªº¦WºÙ¡A«üªº¬O¦b³æ¤@¾÷¾¹¤W¥i¥H¦P®É³Q¤£¦P¤H¨Ï¥Î¡A¦ý¦P®É¥i¥H°õ¦æ«Ü¦hµ{¦¡ªº¨t²Î¡C</para>
<para>¨C¤@ºØ¦h¨Ï¥ÎªÌ¨t²Î³£»Ýn¥i¥H¤À¿ë¤£¦P<quote>¨Ï¥ÎªÌ</quote>ªº¤èªk¡C
¦b FreeBSD (¥H¤Î©Ò¦³ªº &unix;-like §@·~¨t²Î)
¤¤¡A©Ò¦³ªº¨Ï¥ÎªÌ¦b°õ¦æµ{¦¡¤§«e¥²¶·¥ý<quote>µn¤J</quote>¨t²Î¡C
¨CӨϥΪ̳£¦³¤@²Õ¿W¯Sªº±b¸¹¦WºÙ
(<quote>username</quote>)¤Î±K½X(<quote>password</quote>)¡C
FreeBSD ¦b¤¹³\¨Ï¥ÎªÌ°õ¦æµ{¦¡«e±N·|¥ý°Ý³o¨âÓ°ÝÃD¡C</para>
<indexterm><primary>startup scripts</primary></indexterm>
<para>¦b FreeBSD ¶}¾÷¨Ã¶]§¹°_°Êªº script ¤§«á<footnote>
<para>³o¨Ç°_°Êªº script ¬O¦b¶}¾÷ªº®ÉÔ FreeBSD ·|¦Û°Ê°õ¦æªºµ{¦¡¡C
¥LÌ¥Dnªº¥\¯à¬O±N©Ò¦³¸Ó°õ¦æªºªF¦è³]©w¦n¡A¨Ã±N±z³]©w¦¨I´º°õ¦æªºªA°È±Ò°Ê¡C
</para>
</footnote>¡A¥¦±N·|¦L¥X´£¥Ü¦r¤¸n¨D±z¿é¤J¥¿½Tªº±b¸¹¦WºÙ¡G</para>
<screen>login:</screen>
<para>¦b³oÓ½d¨Ò¸Ì¡A§ÚÌ°²³]±zªº±b¸¹¬O<username>john</username>¡C
¦b´£¥Ü¦r¤¸³B¿é¤J
<literal>john</literal> ¨Ã«ö¤U <keycap>Enter</keycap>¡C
±µµÛ±zÀ³¸Ó·|¬Ý¨ì¥t¤@Ó´£¥Ü¦r¤¸n±z¿é¤J<quote>±K½X</quote>¡G
</para>
<screen>login: <userinput>john</userinput>
Password:</screen>
<para>¿é¤J <username>john</username> ªº±K½X¡A¦A«ö¤U
<keycap>Enter</keycap>¡C
¿é¤Jªº±K½X <emphasis>¤£·|Åã¥Ü¦b¿Ã¹õ¤W</emphasis>¡C
±z¤£»Ýn¬°¦¹¾á¤ß¡A³o¼Ë°µ¬O¬°¤F¦w¥þ¤Wªº°ÝÃD¡C</para>
<para>¦pªG±z¿é¤J¤F¥¿½Tªº±K½X¡A±zÀ³¸Ó¤w¸gµn¤J FreeBSD¡C
²{¦b´N¥i¥H¹Á¸Õ©Ò¦³¥i¥Îªº«ü¥O¤F¡C</para>
<para>±zÀ³¸Ó·|¬Ý¨ì<acronym>MOTD</acronym>
(§Y¤µ¤é°T®§¡BMessages Of The Day)¡A«á±±µµÛ©R¥O´£¥Ü¦r¤¸
(¤@Ó <literal>#</literal>,<literal>$</literal>, ©Î¬O
<literal>%</literal> ¦r¤¸)¡C ³o´Nªí¥Ü±z¤w¸g¦¨¥\µn¤J
FreeBSD ¤F¡C</para>
</sect2>
<sect2 id="consoles-virtual">
<title>¦h« Console</title>
<para>¦b¤@Ó Console ¤U°õ¦æ &unix; ·íµM¬O¨S¦³°ÝÃD¡AµM¦Ó
FreeBSD ¬O¥i¥H¦P®É°õ¦æ«Ü¦hµ{¦¡ªº¡C
¹³ FreeBSD ³o¼Ë¥i¥H¦P®É°õ¦æ¤@¤j°ïµ{¦¡ªº§@·~¨t²Î¡A¥u¦³¤@Ó
console ¥i¥H¿é¤J«ü¥O¹ê¦b¬O¦³ÂI®ö¶O¡C
¦b¦¹<quote>virtual consoles</quote>´N«Ü¦³¥Î¤F¡C</para>
<para> FreeBSD ¥i¥H³Q³]©w¦¨¦P®É¦³«Ü¦h
virtual console¡A¥Î´XÓ«öÁ䪺²Õ¦X´N¥i¥H±q¤@Ó
virtual console ¸õ¨ì§Oªº virtual console ¥h¡C
¨C¤@Ó console ³£¦³¦Û¤w¤£¦Pªº¿é¥XÀW¹D¡A ·í±q¬Y¤@Ó
virtual console ¤Á´«¨ì¤U¤@Óªº®ÉÔ¡AFreeBSD
·|¾A·íªº³B²zÁä½L¿é¤J¤Î¿Ã¹õ¿é¥X¡C</para>
<para>FreeBSD «O¯d¤F¯S§Oªº«öÁä²Õ¦X¨Ó¤Á´« console <footnote>
<para>¦b &man.syscons.4;¡B&man.atkbd.4;¡B&man.vidcontrol.1;¡B¥H¤Î
&man.kbdcontrol.1;µ¥ manual page ¤¤¡A¹ï©ó FreeBSD ªº console
¤ÎÁä½LÅX°Êµ{¦¡¦³¸Ô²Óªº§Þ³N»¡©ú¡C §Ú̦b³o¸Ì¤£°Q½×²Ó¸`¡A¦³¿³½ìªºÅªªÌÀH®É¥i¥H¦b
manual page ¤¤¬d¨ìÃö©ó¹B§@¤è¦¡ªº§ó¸Ô²Ó¥B§¹¾ãªº¸ÑÄÀ¡C</para>
</footnote>¡C ±z¥i¥H¥Î
<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 console¡C </para>
<para> ·í±z±q¤@Ó console ¤Á´«¨ì¤U¤@Óªº®ÉÔ¡AFreeBSD
·|³B²z¿Ã¹õ¿é¥XªºÀx¦s¤Î¦^´_¡C
³o´N<quote>¦n¹³</quote>¦³«Ü¦h<quote>µêÀÀ</quote>ªº¿Ã¹õ©MÁä½L¥i¥HÅý±z¿é¤J«ü¥Oµ¹
FreeBSD °õ¦æ¡C ¦b¬Y¤@Ó console ¤W°õ¦æªºµ{¦¡¨Ã¤£·|¦]¬°¤Á¨ì§Oªº console
¦Ó°±¤î°õ¦æ¡A·í±z¤Á´«¨ì¥t¤@Ó console ªº®ÉÔ¡A¥LÌ·|Ä~Äò°õ¦æ¡C</para>
</sect2>
<sect2 id="consoles-ttys">
<title><filename>/etc/ttys</filename> ÀÉ</title>
<para>FreeBSD ¹w³]ªºµêÀÀ console Á`¦@¦³ 8 Ó¡A
¦ý³o¨Ã«Dµw©Ê³W©w¡A±z¥i»´ÃP³]©w³o¨ÇµêÀÀ console ªº¼Æ¶q¼W´î¡C
¦³ÃöµêÀÀ console ªº½s¸¹¸ò³]©w³£¦b
<filename>/etc/ttys</filename> ³oÀɮפº³]©w¡C</para>
<para>¥i¥H¥Î <filename>/etc/ttys</filename> Àɮרӳ]©w
FreeBSD ªºµêÀÀ console¡C Àɮפº¨C¦æ«Dµù¸Ñ¤å¦r(¸Ó¦æ¶}ÀY¨S¦³
<literal>#</literal> ³o¦r)³£¬O³]©w²×ºÝ¾÷©ÎµêÀÀ console¡C
FreeBSD ¹w³]¦³ 9 ÓµêÀÀ console ¦ý¥u±Ò°Ê 8 Ó¡A¤]´N¬O¥H¤U¥H
<literal>ttyv</literal> ¶}ÀYªº¨º´X¦æ³]©w¡C</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Äæ¦ìªº³]©w»P¨ä¥L¿ï¶µ¡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È¥i¥H¦b
<filename>/etc/ttys</filename> ÀÉ°µ½Õ¾ã¡C ¤U±¥H
<literal>console</literal> ¶}ÀYªº¨º¦æ¡A´N¬O¤F¡G</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±ªºµù¸Ñ¦³´£¨ì¡A¥i¥H§â¨º¦æªº
<literal>secure</literal> §ï¬° <literal>insecure</literal>¡A
¦p¦¹¤@¨Ó¡A§Y¨Ï FreeBSD ¶i¤J single user ¼Ò¦¡¡A
¤´·|n¨D±z¿é¤J <username>root</username> ªº±K½X¡C</para>
<para><emphasis>½Ð¼f·V¦Ò¼{¬O§_n§ï¬°
<literal>insecure</literal></emphasis>¡C ¦]¬°¸U¤@§Ñ°O
<username>root</username> ±K½Xªº¸Ü¡AYnµn¤J single user
¼Ò¦¡´N¦³¨Ç³Â·Ð¤F¡C¾¨ºÞÁÙ¦³¨ä¥L¤è¦¡¥i¥Hµn¤J¡A¦ý¹ï¤£¼ô FreeBSD
¶}¾÷µ{§Çªº¤H¦Ó¨¥¡A´N·|¬Û·í´Æ¤â¡C
</para>
</note>
</sect2>
</sect1>
<sect1 id="permissions">
<title>Åv</title>
<indexterm><primary>UNIX</primary></indexterm>
<para>FreeBSD ·½¦Û©ó BSD &unix;¡AÄ~©Ó¤F´XÓ«nªº &unix; ·§©À¡C
º¥ý¤]³Ì©úÅã¡A¥¦¬O¤@´Ú multi-user §@·~¨t²Î¡C
¥¦¥i¥H¦P®É³B²z¦h¤H¦h¤u¡At³d¹ý©³ªº¤À¨É»PºÞ²z¨Ó¦Û¨C¦ì¨Ï¥ÎªÌ¹ï
µwºÐ¸Ë¸m¡B¶gÃä³]³Æ¡B°O¾ÐÅé¤Î CPU ®É¶¡ªºn¨D¡C</para>
<para>¤]¦]¬°¨t²Î¯à°÷¤ä´©¦h¨Ï¥ÎªÌ¡A©Ò¥H¨t²ÎºÞ²zªº¤@¤Á³£¦³Åv
¨Ó¨M©w½Ö¥i¥HŪ¨ú¡B¼g¤J©Î°õ¦æ¸ê·½¡C
³o¨ÇÅv¤À§O¨Ï¥Î¤T²Õ¤K¶i¦ìªº¼Æ¦rÀx¦s¡A¤@²Õ¥NªíÀɮתº©Ò¦³ªÌ
¡A¤@²Õ¥NªíÀɮשÒÄݪº¸s²Õ¡A¦Ó³Ì«á¤@²Õ«h¥Nªí¨ä¥L©Ò¦³¤H¡C
ªí¥Ü³o¨Ç¼Æ¦rªº¤è¦¡¦p¤U:</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Ū¨ú, ¤£¥i¼g¤J, ¤£¥i°õ¦æ</entry>
<entry><literal>---</literal></entry>
</row>
<row>
<entry>1</entry>
<entry>¤£¥iŪ¨ú, ¤£¥i¼g¤J, ¥i°õ¦æ</entry>
<entry><literal>--x</literal></entry>
</row>
<row>
<entry>2</entry>
<entry>¤£¥iŪ¨ú, ¥i¼g¤J, ¤£¥i°õ¦æ</entry>
<entry><literal>-w-</literal></entry>
</row>
<row>
<entry>3</entry>
<entry>¤£¥iŪ¨ú, ¥i¼g¤J, ¥i°õ¦æ</entry>
<entry><literal>-wx</literal></entry>
</row>
<row>
<entry>4</entry>
<entry>¥iŪ¨ú, ¤£¥i¼g¤J, ¤£¥i°õ¦æ</entry>
<entry><literal>r--</literal></entry>
</row>
<row>
<entry>5</entry>
<entry>¥iŪ¨ú, ¤£¥i¼g¤J, ¥i°õ¦æ</entry>
<entry><literal>r-x</literal></entry>
</row>
<row>
<entry>6</entry>
<entry>¥iŪ¨ú, ¥i¼g¤J, ¤£¥i°õ¦æ</entry>
<entry><literal>rw-</literal></entry>
</row>
<row>
<entry>7</entry>
<entry>¥iŪ¨ú, ¥i¼g¤J, ¥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; ±z¥i¥H¥Î <option>-l</option> °µ¬°¨ä°Ñ¼Æ¡A
¨ÓÀ˵ø¸Ô²Óªº¥Ø¿ý²M³æ¡C
²M³æ¤¤Äæ¦ìªº¸ê°T¥]§tÀÉ®×¹ï©Ò¦³ªÌ¡B¸s²Õ¤Î¨ä¥L¤HªºÅv¡C
¦bÀH«K¤@ӥؿý©³¤U°õ¦æ <command>ls -l</command>¡A·|Åã¥Ü¦p¤Uªºµ²ªG:
</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>¦b³o¸Ì§i©Ò±z¸Ó¦p¦ó°Ï¤À <command>ls -l</command>
²Ä¤@Äæ·í¤¤ªº¸ê°T:</para>
<screen>-rw-r--r--</screen>
<para>²Ä¤@Ó (³Ì¥ªÃä) ªº¦r¤¸¥Î¨Óªí¥Ü³oÓÀɮתºÃþ«¬¬°¦ó¡A
°£¼Ð·ÇÀÉ®×¥H¥~¡A©|¦³¥Ø¿ý¡B¯S®í¦r¤¸¸Ë¸m (Special character device)¡B
Socket ¤Î¨ä¥L¯S®íµêÀÀÀɮ׸˸m (Special pseudo-file device)¡A
¦b¦¹¨Ò·í¤¤¡A<literal>-</literal> ªí¥Ü¸ÓÀɮ׬°¤@ӼзǪºÀɮסC
½d¨Ò¤¤±µ¤U¨Óªº¤TÓ¦r¤¸¤¤¡A<literal>rw-</literal>
¥Nªí©Ò¦³ªÌ¹ïÀÉ®×¾Ö¦³ªºÅv¡C ¦A±µ¤U¨Óªº¤TÓ¦r¤¸¡A
<literal>r--</literal> «h¥Nªí¸s²Õ¹ïÀÉ®×¾Ö¦³ªºÅv¡A
³Ì«á¤TÓ¦r¤¸¡A<literal>r--</literal> «h¥Nªí¨ä¥L¤H¹ïÀÉ®×¾Ö¦³ªºÅv¡C
¯}§é¸¹ (-) ªí¥Ü¨S¦³Åv¡A½d¨Ò¤¤ªº³oÓÀɮתºÅv¡A
¥u¤¹³\©Ò¦³ªÌŪ¨ú¡B¼g¤JÀɮסA¸s²Õ¥H¤Î¨ä¥L¤H¶È¯àŪ¨úÀɮסC
®Ú¾Ú¥H¤Wªºªí®æ¡A¦¹ºØÅvªºÀÉ®×¥i¥H¨Ï¥Î <literal>644</literal> ¨Óªí¥Ü¡A
¨C²Õ¼Æ¦r¤À§O¥NªíÀɮתº¤TºØÅv¡C</para>
<para>¥H¤W¬O¤£¿ùªº¤è¦¡¡A¦ý¨t²Î¸Ó¦p¦ó±±¨î¸Ë¸mªºÅv¡H ¹ê»Ú¤W FreeBSD
¹ï¤j¦hªºµwºÐ¸Ë¸m´N¦p¦PÀɮסAµ{¦¡¥i¥H¶}±Ò¡BŪ¨ú¥H¤Î¼g¤J¸ê®Æ¦p¤@¯ëÀɮסC
³o¨Ç¯S®í¸Ë¸mÀÉ®× (Special device file) ³£Àx¦s©ó <filename>/dev</filename>
¥Ø¿ý¤¤¡C</para>
<para>
¥Ø¿ý¤]¦P¦pÀɮסA¾Ö¦³Åª¨ú¡B¼g¤J¤Î°õ¦æªºÅv¡A¦ý¦b°õ¦æÅv¤W»PÀɮצ³©úÅ㪺®t²§¡C
·í¥Ø¿ý³Q¼Ð¥Ü¬°¥i°õ¦æ®É¡A¥Nªí¥i¥H¨Ï¥Î <quote>cd</quote>
(§ó§ï¥Ø¿ý) ¶i¤J¸Ó¥Ø¿ý¡C¤]¥Nªí¯à°÷¦s¨ú¦b¦¹¥Ø¿ý¤§¤¤ªº¤wª¾ÀɦWªºÀÉ®×
(·íµM¡AÀɮפ´¾Ö¦³¦Û¤vªºÅv)</para>
<para>¤×¨ä¡An¯à°÷¦C¥X¥Ø¿ý¤º®e¡A¥²¶·¾Ö¦³¥Ø¿ýªºÅª¨úÅv¡C
¦Ó·ín§R°£¤wª¾ÀɦWªºÀɮ׮ɡA¤]¥²¶·¾Ö¦³ÀɮשҦb¥Ø¿ýªº¼g¤J
<emphasis>¥H¤Î</emphasis> °õ¦æªºÅv¡C</para>
<para>ÁÙ¦³¤@¨ÇÅv¡A¦ý³o¨ÇÅv¥Dn¦b¯S®í±¡ªp¨Ï¥Î¡A¦p setuid binaries
¤Î sticky directories¡C
¦pªG±zÁÙ·Qª¾¹D§ó¦hÀÉ®×Åvªº¸ê°T¤Î¨Ï¥Î¤èªk¡A½Ð°È¥²°Ñ¾\
&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ÀɮשΥؿýªºÅv¡C
²Å¸¹ªí¥Üªº®æ¦¡¨Ì§Ç¬° (¬Y¤H)(°Ê§@)(Åv)¡A¥i¨Ï¥Îªº²Å¸¹¦p¤U:</para>
<informaltable frame="none" pgwide="1">
<tgroup cols="3">
<thead>
<row>
<entry>¶µ¥Ø</entry>
<entry>¦r¥À</entry>
<entry>·N¸q</entry>
</row>
</thead>
<tbody>
<row>
<entry>(¬Y¤H)</entry>
<entry>u</entry>
<entry>¨Ï¥ÎªÌ</entry>
</row>
<row>
<entry>(¬Y¤H)</entry>
<entry>g</entry>
<entry>¸s²Õ©Ò¦³ªÌ</entry>
</row>
<row>
<entry>(¬Y¤H)</entry>
<entry>o</entry>
<entry>¨ä¥L</entry>
</row>
<row>
<entry>(¬Y¤H)</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>«ü©wÅv</entry>
</row>
<row>
<entry>(Åv)</entry>
<entry>r</entry>
<entry>Ū¨ú</entry>
</row>
<row>
<entry>(Åv)</entry>
<entry>w</entry>
<entry>¼g¤J</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>¦p¥ý«e¦P¼Ë¨Ï¥Î &man.chmod.1; «ü¥O¨Ó³]©w¡A¦ý¨Ï¥Îªº°Ñ¼Æ¬°³o¨Ç¦r¤¸¡C
¨Ò¦p¡A±z¥i¥H¨Ï¥Î¤U¦C«ü¥O¸T¤î¨ä¥L¨Ï¥ÎªÌ¦s¨úÀÉ®× <replaceable>FILE</replaceable>:</para>
<screen>&prompt.user; <userinput>chmod go= FILE</userinput></screen>
<para>Y¦³¨âÓ¥H¤Wªº²Å¸¹ªí¥Ü¥i¥H¨Ï¥Î³r¸¹(,)°Ï¹j¡C
¨Ò¦p¡A¤U¦C«ü¥O±N·|²¾°£¸s²Õ¤Î¨ä¥L¤H
¹ïÀÉ®× <replaceable>FILE</replaceable> ªº¼g¤JÅv¡A
¨Ã¨Ï©Ò¦³¤H(<quote>world</quote>)¹ï¸ÓÀɦ³°õ¦æÅv¡C</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>°£¤F«e±´£¨ìªºÀÉ®×Åv¥~¡A&os; ¤ä´©¨Ï¥Î <quote>Àɮ׺X¼Ð</quote>¡C
³o¨ÇºX¼Ð¼W¥[¤FÀɮתº¦w¥þ©Ê¤ÎºÞ²z©Ê¡A¦ý¤£¥]§t¥Ø¿ý¡C</para>
<para>Àɮ׺X¼Ð¼W¥[¤FºÞ²z©Ê¡A½T«O¦b¬Y¨Ç®ÉÔ <username>root</username>
¤£·|·N¥~±NÀÉ®×קï©Î²¾°£¡C</para>
<para>ק諸ÀÉ®× flag ¶È»Ýn¨Ï¥Î¾Ö¦³Â²©öªº¤¶±ªº &man.chflags.1; ¤u¨ã¡C
¨Ò¦p¡A¼Ð¥Ü¨t²Î¸T¤î§R°£ªººX¼Ð©óÀÉ®×
<filename>file1</filename>¡A¨Ï¥Î¤U¦C«ü¥O:</para>
<screen>&prompt.root; <userinput>chflags sunlink <filename>file1</filename></userinput></screen>
<para>Yn²¾°£¨t²Î¸T¤î§R°£ªººX¼Ð¡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À˵øÀɮץثeªººX¼Ð:</para>
<screen>&prompt.root; <userinput>ls -lo <filename>file1</filename>
</userinput></screen>
<para>¿é¥Xªºµ²ªG¦p¤U:</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¥ÑÀɮשҦ³ªÌ³]©w¡C
³o¸Ì«ØijºÞ²zªÌ¾\Ū &man.chflags.1; ¤Î &man.chflags.2;
»¡©ú¤å¥ó¨ú±o§ó¦hªº¬ÛÃö¸ê°T¡C</para>
</sect2>
</sect1>
<sect1 id="dirstructure">
<title>¥Ø¿ýµ²ºc</title>
<indexterm><primary>directory hierarchy</primary></indexterm>
<para>»{ÃÑ FreeBSD ªº¥Ø¿ý¬[ºc¡A´N¥i¹ï¨t²Î¦³·§²¤ªº°ò¦²z¸Ñ¡C
³Ì«nªº²ö¹L©ó¾ãӥؿýªº®Ú¥Ø¿ý¡A´N¬O <quote>/</quote>
¥Ø¿ý¡A³o¥Ø¿ý·|¦b¶}¾÷®É²Ä¤@Ó¥ý±¾¸ü (mount)¡A¨ä¤¤¸Ì±¦³µ¹
multi-user ¾Þ§@ªº°ò¥»¨t²Î¡C®Ú¥Ø¿ý¤]·|°O¿ý¨CÓÀɮרt²Î¤§¬ÛÃö±¾¸üÂI
(mount point)¡C</para>
<para>±¾¸üÂI´N¬OÅý·s¼WªºÀɮרt²Î¡A¯à±µ¤W®Ú¥Ø¿ýÀɮרt²Îªº¥Ø¿ý¡C
¦b <xref linkend="disk-organization"> ³oÃä¹ï¦¹¦³§ó¸Ô²Ó¤¶²Ð¡C
¼Ð·Çªº±¾¸üÂI¥]¬A¤F
<filename>/usr</filename>, <filename>/var</filename>, <filename>/tmp</filename>,
<filename>/mnt</filename>¡A¥H¤Î <filename>/cdrom</filename>¡C
³o¨Ç¥Ø¿ý³q±`·|°O¿ý¦b <filename>/etc/fstab</filename> ³]©wÀɤº¡C
<filename>/etc/fstab</filename> ¬O°O¿ý¦UÀɮרt²Î¤Î¬ÛÃö±¾¸üÂIªºªí®æ¡C
¤j³¡¤À¦b <filename>/etc/fstab</filename>
°O¿ýªºÀɮרt²Î¡A·|¦b¶}¾÷®É¥Ñ &man.rc.8; script ¨Ó¦Û°Ê±¾¸ü¡A°£«D¥¦Ì¦³³]©w
<option>noauto</option> ¿ï¶µ¡C²Ó¸`»¡©ú¥i°Ñ¾\ <xref linkend="disks-fstab">¡C
</para>
<para>¦³ÃöÀɮרt²Î¬[ºcªº§¹¾ã»¡©ú¥i°Ñ¾\ &man.hier.7;¡C
²{¦b©O¡AÅý§Ṳ́jP¥ý¤@¿s±`¨£ªº¥Ø¿ý¦³þ¨Ç§a¡C</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 ªº°ò¥»¤u¨ã¡C</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 nodes¡A¸Ô±¡½Ð°Ñ¾\ &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ÀÉ¡A¹³¬O &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>¨C¤é¡B¨C¶g¡B¨C¤ë³z¹L &man.cron.8;; °õ¦æªº©w´Á±Æµ{ script¡A
¸Ô±¡½Ð°Ñ¾\ &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> ±b¸¹ªº®a¥Ø¿ý¡C</entry>
</row>
<row>
<entry><filename class="directory">/sbin/</filename></entry>
<entry>¨Ñ single-user ¤Î multi-user Àô¹Ò¨Ï¥Îªº¨t²Îµ{¦¡¤ÎºÞ²z¤u¨ã¡C</entry>
</row>
<row>
<entry><filename class="directory">/tmp/</filename></entry>
<entry>Á{®ÉÀɮסC ¤@¯ë¦Ó¨¥¡A«¶}¾÷¤§«á
<filename class="directory">/tmp</filename> ¤ºªºªF¦è·|³Q²M°£±¼¡C
¦Ó³q±`·|±N memory-based Àɮרt²Î±¾¸ü¦b
<filename class="directory">/tmp</filename> ¤W¡C
³o¨Çº¾¨Æ¥i³z¹L tmpmfs ¬ÛÃöªº &man.rc.conf.5; Àô¹ÒÅܼƨӦ۰ʧ¹¦¨¡C
(©Î¬O¦b
<filename>/etc/fstab</filename> ¤º°µ³]©w¡A¸Ô±¡½Ð°Ñ¾\ &man.mdmfs.8;¡C)</entry>
</row>
<row>
<entry><filename class="directory">/usr/</filename></entry>
<entry>¥Dn¬O¨Ï¥ÎªÌ©Ò¦w¸Ëªº¤u¨ãµ{¦¡¡BÀ³¥Îµ{¦¡¦s©ñ³B¡C</entry>
</row>
<row>
<entry><filename class="directory">/usr/bin/</filename></entry>
<entry>±`¥Î¤u¨ã¡B¶}µo¤u¨ã¡BÀ³¥Î³nÅé¡C</entry>
</row>
<row>
<entry><filename class="directory">/usr/include/</filename></entry>
<entry>¼Ð·Ç C include ªº¬ÛÃö header ÀÉ®×®w¡C</entry>
</row>
<row>
<entry><filename class="directory">/usr/lib/</filename></entry>
<entry>¨ç¦¡®w¦s©ñ³B¡C</entry>
</row>
<row>
<entry><filename class="directory">/usr/libdata/</filename></entry>
<entry>¨ä¥L¦U¦¡¤u¨ãªº¸ê®ÆÀÉ¡C</entry>
</row>
<row>
<entry><filename class="directory">/usr/libexec/</filename></entry>
<entry>¨t²Î daemons ¤Î¨t²Î¤u¨ãµ{¦¡(³z¹L¨ä¥Lµ{¦¡¨Ó°õ¦æ)¡C</entry>
</row>
<row>
<entry><filename
class="directory">/usr/local/</filename></entry>
<entry>¦s©ñ¤@¨Ç¦Û¦æ¦w¸Ëªº°õ¦æÀÉ¡B¨ç¦¡®wµ¥µ¥¡C ¦P®É¡A¤]¬O FreeBSD
ports ¬[ºcªº¹w³]¦w¸Ë¥Ø¿ý¡C <filename>/usr/local</filename>
¤ºªº¥Ø¿ý¬[ºc¤jP»P <filename>/usr</filename> ¬Û¦P¡A¸Ô±¡½Ð°Ñ¾\
&man.hier.7; »¡©ú¡C¦ý man ¥Ø¿ý¨Ò¥~¡A¥¦Ì¬Oª½±µ©ñ¦b
<filename>/usr/local</filename> ©³¤U¡A¦Ó«D <filename>/usr/local/share</filename>¡A
¦Ó ports ©Ò¦w¸Ëªº»¡©ú¤å¥ó«h¦b
<filename>share/doc/<replaceable>port</replaceable></filename>¡C
</entry>
</row>
<row>
<entry><filename class="directory">/usr/obj/</filename></entry>
<entry>¦b½sĶ <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 ¥»¨ªºì©l½X(©Î¦Û¦æ·s¼Wªº)¡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>¦s©ñ¦UºØ¥Î³~ªº log ÀÉ¡BÁ{®É©Î¼È®É¦s©ñ¡B¦C¦L©Î¶l¥óªº
spool ÀɮסC¦³®ÉÔ¡Amemory-based Àɮרt²Î¤]·|±¾¸ü¦b
<filename class="directory">/var</filename>¡C
³o¨Çº¾¨Æ¥i³z¹L varmfs ¬ÛÃöªº &man.rc.conf.5
Àô¹ÒÅܼƨӦ۰ʧ¹¦¨¡C(©Î¬O¦b
<filename>/etc/fstab</filename> ¤º°µ³]©w¡A¬ÛÃö²Ó¸`½Ð°Ñ¾\
&man.mdmfs.8;¡C)</entry>
</row>
<row>
<entry><filename class="directory">/var/log/</filename></entry>
<entry>¦U¶µ¨t²Î°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ºØ¦Lªí¾÷¡B¶l¥ó¨t²Îªº spool ¥Ø¿ý¡C</entry>
</row>
<row>
<entry><filename class="directory">/var/tmp/</filename></entry>
<entry>Á{®ÉÀɮסC
³o¨ÇÀɮצb«¶}¾÷«á³q±`¤´·|«O¯d¡A°£«D
<filename class="directory">/var</filename>
¬OÄÝ©ó memory-based Àɮרt²Î¡C</entry>
</row>
<row>
<entry><filename>/var/yp</filename></entry>
<entry>°O¿ý NIS maps¡C</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</sect1>
<sect1 id="disk-organization">
<title>ºÏºÐ²Õ´</title>
<para> FreeBSD ¥Î¨Ó´M§äÀɮתº³Ì¤p³æ¦ì´N¬OÀɮתº¦WºÙ¤F¡C
Àɮתº¦WºÙ¦³¤j¤p¼g¤§¤À¡A©Ò¥H»¡ <filename>readme.txt</filename>
©M <filename>README.TXT</filename> ¬O¨âÓ¤£¦PªºÀɮסC
FreeBSD ¨Ã¤£¨Ï¥Î°ÆÀɦW (<filename>.txt</filename>)
¨Ó§P§O³o¬O¤@Óµ{¦¡ÀÉ¡B¤å¥óÀɩάO¨ä¥LÃþ«¬ªºÀɮסC</para>
<para>Àɮצs¦b¥Ø¿ý¸Ì±¡C
¤@ӥؿý¤¤¥i¯à¨S¦³¥ô¦óÀɮסA¤]¥i¯à¦³¦n´X¦ÊÓÀɮסC
¥Ø¿ý¤§¤¤¤]¥i¥H¥]§t¨ä¥Lªº¥Ø¿ý¡F±z¥i¥H«Ø¥ß¶¥¼h¦¡ªº¥Ø¿ý¥H«K¸ê®ÆªººÞ²z¡C
</para>
<para>ÀɮשΥؿýªº¹ïÀ³¬OÂǥѵ¹©wªºÀɮשΥؿý¦WºÙ¡AµM«á¥[¤W¥¿±×½u²Å¸¹
(<literal>/</literal>)¡F¤§«á¦Aµø»Ýn¥[¤W¨ä¥Lªº¥Ø¿ý¦WºÙ¡C
¦pªG±z¦³¤@ӥؿý <filename>foo</filename> ¡A¸Ì±¦³¤@ӥؿý¥s§@
<filename>bar</filename> ¡A³oӥؿý¤¤¤S¥]§t¤F¤@Ó¥s
<filename>readme.txt</filename>
ªºÀɮסA¨º»ò³oÓÀɮתº¥þ¦W¡A©ÎªÌ»¡Àɮתº<firstterm>¸ô®|</firstterm>´N¬O
<filename>foo/bar/readme.txt</filename> ¡C</para>
<para>¥Ø¿ý¤ÎÀÉ®×Àx¦s¦bÀɮרt²Î¤§¤¤¡C
¨CÓÀɮרt²Î³£¦³°ß¤@¤@ӳ̤W¼hªº¥Ø¿ý¡A¥s°µ<firstterm>®Ú¥Ø¿ý
(root directory)</firstterm>¡CµM«á¦b³oӮڥؿý¤U±¤~¯à¦³¨ä¥Lªº¥Ø¿ý¡C
</para>
<para>¨ì¥Ø«e¬°¤î¤j·§©M¨ä¥L±z¥Î¹Lªºªº§@·~¨t²Î³£®t¤£¦h¡C
ÁÙ¬O¦³¨Ç¤£¤@¼Ëªº¦a¤è´N¬O¤F¡A¨Ò¦p &ms-dos; ¥Î <literal>\</literal>
·íÀɮשM¥Ø¿ý¦WºÙªº¤À¹j²Å¸¹¡A¦Ó &macos; «h¬O¥Î <literal>:</literal>
²Å¸¹¡C</para>
<para>FreeBSD ªº¸ô®|¤¤¨Ã¨S¦³¨Ï¥ÎºÏºÐ¾÷¥N¸¹©Î¨ä¥LªººÏºÐ¦WºÙ¡C
¦]¦¹¡A±z¤£¥i¥H¨Ï¥Î¹³ <filename>c:/foo/bar/readme.txt</filename>
³o¼Ë¤lªºÀɮצWºÙ¡C</para>
<para>¬Û¹ïªº¡A¦b FreeBSD
¨t²Î¤¤¦³¤@ÓÀɮרt²Î³Q«ü©w¬°<firstterm>®ÚÀɮרt²Î</firstterm>¡C
®ÚÀɮרt²Îªº®Ú¥Ø¿ý¥Ñ <literal>/</literal> ªí¥Ü¡C
µM«á¨ä¥LªºÀɮרt²Î¦A<firstterm>±¾¸ü (mount)</firstterm>
¦b®ÚÀɮרt²Î¤§¤U¡C¦]¦¹µL½×±zªº FreeBSD
¨t²Î¤W¦³¦h¤ÖÁûµwºÐ¡A¨C¤@ӥؿý¬Ý°_¨Ó´N¹³¦b¦P¤@ӺϺФW¡C</para>
<para>°²³]±z¦³¤TÓÀɮרt²Î¡A¤À§O¥s§@ <literal>A</literal>¡B
<literal>B</literal> ¤Î <literal>C</literal> ¡C
¨CÓÀɮרt²Î³£¥]§t¨âӥؿý¡A¥s°µ
<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²Î¡F¦pªG±z¥Î
<command>ls</command> «ü¥O¬d¬Ý¦¹¥Ø¿ýªº¤º®e¡A±z·|¬Ý¨ì¨âÓ¤l¥Ø¿ý¡G
<literal>A1</literal> ¤Î <literal>A2</literal> ¡A¦p¤U©Ò¥Ü¡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²Î¤W¡C
¦]¦¹¡A°²³]±z±N <literal>B</literal> ±¾¸ü©ó <literal>A1</literal>
¤§¤W¡A«h <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> ¤~¯à¹F¨ì¡C
©Ò¦³ì¨Ó¦b <filename>/A1</filename> ¤¤ªºÀÉ®×·|¼È®É³QÁôÂð_¨Ó¡Aª½¨ì
<literal>B</literal> ³Q¡u<firstterm>²¾°£
(unmounted)</firstterm>¡v«á¤~·|¦AÅã²{¥X¨Ó¡C</para>
<para>¦pªG <literal>B</literal> ±¾¸ü¦b <literal>A2</literal>
¤§¤W¡A«h·|Åܦ¨¡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²Î¥i¥H±¾¦b¨ä¥LÀɮרt²Îªº¥Ø¿ý¤§¤W¡C
©µÄò¤§«eªº¨Ò¤l¡A<literal>C</literal> Àɮרt²Î¥i¥H±¾¦bÀɮרt²Î
<literal>B</literal> ªº <literal>B1</literal> ¥Ø¿ý¤§¤W¡A¦p¹Ï©Ò¥Ü¡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> ¥Ø¿ý¤§¤W¡G</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>¦pªG±z¼ô±x &ms-dos; ªº¸Ü¡A³o©M <command>join</command>
«ü¥O«ÜÃþ¦ü (ÁöµM¤£¾¨¬Û¦P)¡C</para>
<para>¤@¯ë±¡ªp¤U±z¤£»Ýn¾á¤ß³o¨ÇªF¦è¡C
°£«D±zn¦w¸Ë·sªººÏºÐ¡A¤£µM³q±`¦b±z¦w¸Ë FreeBSD
®É«Ø¥ß¦nÀɮרt²Î¨Ã¨M©w¦nn±¾¸ü¦b¦ó³B¤§«á´N¤£·|¦A°µ¥ô¦ó§ó°Ê¤F¡C</para>
<para>±z§¹¥þ¥i¥H¨Ï¥Î³æ¤@ªº¤@Ó¤jªº®ÚÀɮרt²Î (root file system)
¦Ó¤£«Ø¥ß¨ä¥LªºÀɮרt²Î¡C ³o¼Ë¦³¦n³B¤]¦³¦³Ãa³B¡C</para>
<itemizedlist>
<title>¨Ï¥Î¦hÓÀɮרt²Îªº¦n³B</title>
<listitem>
<para>¤£¦PªºÀɮרt²Î¦b±¾¤Wªº®ÉÔ¥i¥H¦³¤£¦Pªº<firstterm>±¾¸ü°Ñ¼Æ</firstterm>¡C
Á|¨Ò¨Ó»¡¡A¬°¨DÂÔ·V±z¥i¥H±N®ÚÀɮרt²Î³]¦¨°ßŪ¡A¥HÁקK¤£¤p¤ß§R°£©Îקﱼ«nªºÀɮסC
±N¨Ï¥ÎªÌ¥i¼g¤JªºÀɮרt²Î (¨Ò¦p <filename>/home</filename>)
¿W¥ß¥X¨Ó¤]¥i¥HÅý¥L̥Π<firstterm>nosuid</firstterm>
ªº°Ñ¼Æ±¾¸ü¡A¦¹¿ï¶µ¥i¥HÅý¦b³oÓÀɮרt²Î¤¤°õ¦æÀɪº
<firstterm>suid</firstterm>/<firstterm>guid</firstterm>
bits ¥¢®Ä¡A¤]³\¥i¥HÅý¨t²Î§ó¦w¥þ¡C</para>
</listitem>
<listitem>
<para>FreeBSD ·|¦Û°Ê®Ú¾Ú±zÀɮרt²Îªº¨Ï¥Î¤è¦¡¨Ó°µ³Ì¨ÎªºÀÉ®×°t¸m¤è¦¡¡C
¦]¦¹¡A¤@Ó¦³«Ü¦h¤pÀɮסB±`±`¼g¤JªºÀɮרt²Î¸ò¥u¦³´XÓ¸û¤jªºÀɮתºÀɮרt²Î°t¸m¬O¤£¤@¼Ëªº¡C ¦pªG±z¥u¦³³æ¤@¤@Ó¤jªºÀɮרt²Î¡A³o³¡¤À´N¨S¥Î¤F¡C</para>
</listitem>
<listitem>
<para>FreeBSD ªºÀɮרt²Î¦b°±¹qªº®ÉÔ«ÜéT¡C
µM¦Ó¡A¦b¬Y¨Ç«nªº®ÉÔ°±¹q¤´µM·|¹ïÀɮרt²Îµ²ºc³y¦¨·l®`¡C
¤À³Î¦¨³\¦hÓÀɮרt²Îªº¸Ü¦b¨t²Î¦b°±¹q«á¤ñ¸û¯à°÷¥¿±`±Ò°Ê¡A¥H«K±z¦b»Ýnªº®ÉÔ±N³Æ¥÷¸ê®Æ¦^¦s¦^¨Ó¡C</para>
</listitem>
</itemizedlist>
<itemizedlist>
<title>¨Ï¥Î³æ¤@Àɮרt²Îªº¦n³B</title>
<listitem>
<para>Àɮרt²Îªº¤j¤p¬O©T©wªº¡C
±z·íªì¦w¸Ë FreeBSD
ªº®ÉÔÀ³¸Ó·|µ¹©w¤@Ó¤j¤p¡A¥i¬O«á¨Ó±z¥i¯à·|·Q§âªÅ¶¡¥[¤j¡C
¦pªG¨S¦³³Æ¥÷ªº¸Ü¬O«ÜÃø¹F¦¨ªº¡F
±z¥²¶·±NÀɮרt²Î«·s«Ø¥ß¬°±z»Ýnªº¤j¤p¡AµM«á±N³Æ¥÷¦^¦s¦^¨Ó¡C</para>
<important>
<para>FreeBSD 4.4 ¤§«áªºª©¥»¦³¤@Ó«ü¥O¡G &man.growfs.8;
¥i¥H¬ð¯}¦¹¨îª½±µÅܧóÀɮרt²Îªº¤j¤p¡C</para>
</important>
</listitem>
</itemizedlist>
<para>Àɮרt²Î¥]§t¦b¤À³Î°Ï¸Ì±¡C
¦]¬° &os; ©Óŧ &unix ¬[ºc¡A³oÃäÁ¿ªº¤À³Î°Ï©M¤@¯ë´£¨ìªº¤À³Î°Ï
(¨Ò¦p &ms-dos; ¤À³Î°Ï) ¤£¦P¡C ¨C¤@Ó¤À³Î°Ï¥Ñ¤@Ó¥N¸¹(¦r¥À)ªí¥Ü¡A±q
<literal>a</literal> ¨ì <literal>h</literal>¡C
¨CÓ¤À³Î°Ï¥u¯à¥]§t¤@ÓÀɮרt²Î¡C
¦]¦¹°£¤F»¡±`¨£¨ì¥ÎÀɮרt²Î¦Pªº±¾¸üÂI¨Óªí¥ÜÀɮרt²Î¥~¡A¤]¥i¥H¥Î¥]§t¥Lªº¤À³Î°Ï¥N¸¹¨Óªí¥Ü¡C</para>
<para>FreeBSD ¤]·|®³ºÏºÐªÅ¶¡¨Ó·í <firstterm>swap space</firstterm>¡C
Swap space µ¹ FreeBSD ·í§@<firstterm>µêÀÀ°O¾ÐÅé</firstterm>¥Î¡C
³oÅý±zªº¹q¸£¦n¹³¾Ö¦³¤ñ¹ê»Ú§ó¦hªº°O¾ÐÅé¡C
·í FreeBSD ªº°O¾ÐÅé¥Î§¹ªº®ÉÔ¡A¥¦·|§â¤@¨Ç¥Ø«e¨S¥Î¨ìªº¸ê®Æ²¾¨ì
swap space¡AµM«á¦b¥Î¨ìªº®ÉÔ²¾¦^¥h (¦P®É²¾¥X³¡¥÷¨S¥Î¨ìªº)¡C</para>
<para>¬Y¨Ç¤À³Î°Ï¦³ºD¨Òªº¨Ï¥Î¤è¦¡¦p¤U¡G</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 ªº¤j¤p¤@¼Ë¡Aµ¹¤@¨Ç·|¥Î¨ì¾ãÓ slice
ªº¤u¨ãµ{¦¡ (¨Ò¦pµwºÐÃayÀˬd¤u¨ã) ¨Ó¨Ï¥Î¡C
¤@¯ë¨Ó»¡±zÀ³¸Ó¤£·|§âÀɮרt²Î«Ø¥ß¦b³oÓ¤À³Î°Ï¡C</entry>
</row>
<row>
<entry><literal>d</literal></entry>
<entry>¤À³Î°Ï <literal>d</literal>
´¿¸g¦³¥Nªí¯S®í·N¸q¡A¦ý¬O¤w¸g¤£¦A¨Ï¥Î¡C
©Ò¥H²{¦b <literal>d</literal>
´N©M¨ä¥L¤@¯ëªº¤À³Î°Ï¬Û¦P¤F¡C</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>¨CÓ¥]§t¦³Àɮרt²Îªº¤À³Î°Ï¬O¦s¦b©Ò¿×ªº
<firstterm>slice</firstterm> ¸Ì±¡C
FreeBSD ªº slice ´N¬O«ü¥±`§Ú̺٬°¤À³Î°Ï (partition) ªºªF¦è¡C
¦P¼Ë¦a¡A·|³o¼Ë¤lºÙ©I¤]¬O¦]¬° FreeBSD ªº &unix; ¦â±m¡C
¦Ó slice ¬O¦³½s¸¹ªº¡A±q 1 ¸¹½s¨ì 4 ¸¹¡C</para>
<indexterm><primary>slices</primary></indexterm>
<indexterm><primary>partitions</primary></indexterm>
<indexterm><primary>dangerously dedicated</primary></indexterm>
<para>slice ¸¹½X¸ò¦b¸Ë¸m¦WºÙ«á±¡A¥ý±µ¤@Ó¦r¥À
<literal>s</literal>¡AµM«á±q 1 ¸¹¶}©l½s¤U¥h¡C
¦]¦¹ <quote>da0<emphasis>s1</emphasis></quote> ´N¬O«ü²Ä¤@Ó SCSI
µwºÐªº²Ä¤@Ó slice¡C ¤@ӺϺФW¥u¯à¦³¥|Ó¹êÅ骺 slice¡A¦ý¬O¦b¹êÅ骺
slice ¤¤±z¥i¥H¶ë¶i¾A·íÃþ«¬ªºÅÞ¿è slice¡C ³o¨Ç©µ¦ùªº slice ½s¸¹±q 5
¶}©l¡A©Ò¥H <quote>ad0<emphasis>s5</emphasis></quote> ¬O²Ä¤@Ó IDE
µwºÐ¤Wªº²Ä¤@Ó©µ¦ù slice¡C Àɮרt²Î¦b¸Ë¸m (device) ¸Ì´N¬O¦b¤@Ó slice
¤§¤¤¡C</para>
<para>Slices¡B<quote>dangerously dedicated</quote>
¼Ò¦¡ªº¹êÅéºÏºÐ¾÷¡A¥H¤Î¨ä¥L¥]§t<firstterm>¤À³Î°Ï</firstterm>ªººÏºÐ³£¬O¥H¦r¥À
<literal>a</literal>¨ì¦r¥À<literal>h</literal>ªº½s¸¹¨Óªí¥Ü¡C
½s¸¹¬O±µ¦b¸Ë¸m¦WºÙªº«á±ªº¡A¦]¦¹
<quote>da0<emphasis>a</emphasis></quote> ¬OºÏºÐ¾÷ da ¤Wªº²Ä¤@Ó
<quote>dangerously dedicated</quote>¼Ò¦¡¤§¤À³Î°Ï¡C
¦Ó <quote>ad1s3<emphasis>e</emphasis></quote>
«h¬O²Ä¤GÁû IDE µwºÐ¤W²Ä¤TÓ slice ªº²Ä¤Ó¤À³Î°Ï¡C</para>
<para>³Ì«á¡A§ÚÌ´N¥i¥H§â¨t²Î¤Wªº¨CӺϺг£°Ï¤À¥X¨Ó¤F¡C
¤@ӺϺЪº¦WºÙ·|¦³¤@Ó¥N½X¨Óªí¥Ü³oӺϺЪºÃþ«¬¡A±µµÛ¬O¤@ӼƦr¡Aªí¥Ü³o¬Oþ¤@ӺϺСC
³oÃä¸ò slice ¨CӺϺнs¸¹±q 0 ¶}©l¤£¤@¼Ë¡C
±`¨£ªº¥N½X¥i¥H°Ñ¦Ò <xref linkend="basics-dev-codes">.</para>
<para>·ín°Ñ·Ó¤@Ó¤À³Î°Ïªº®ÉÔ¡AFreeBSD »Ýn±z¤@¨Ö¿é¤J¥]§t³oÓ¤À³Î°Ïªº
slice ¤ÎºÏºÐ¾÷¦WºÙ¡F·ín°Ñ·Ó¤@Ó slice ªº®ÉÔ¡A¤]¥²¶·¿é¤J¥]§t³oÓ
slice ªººÏºÐ¦WºÙ¡C «ç»ò°µ©O¡H º¥ý¥ý¦C¥XºÏºÐ¦WºÙ¡AµM«á
<literal>s</literal> ¥[¤W slice ½s¸¹¡A³Ì«á¦A¿é¤J¤À³Î°Ï¦r¥À¥N¸¹¡C
½d¨Ò¥i¥H°Ñ¦Ò <xref linkend="basics-disk-slice-part">.</para>
<para><xref linkend="basics-concept-disk-model">
¥Ü½d¤F¤@Ó°ò¥»ªººÏºÐ¤À¥¬¼Ò¦¡¡A¬Û«H¹ï±z¦³¨ÇÀ°§U¡C</para>
<para>n¦w¸Ë FreeBSD¡A±z¥²¶·¥ý«Ø¸mºÏºÐªº slice¡A±µµÛ©ó slice ¤¤«Ø¥ßnµ¹
FreeBSD ¥Îªº¤À³Î°Ï¡C ³Ì«á¦b³o¨Ç¤À³Î°Ï¤¤«Ø¥ßÀɮרt²Î (©Î swap space)
¨Ã¨M©wn±N³o¨ÇÀɮרt²Î±¾¸ü©óþ¸Ì¡C</para>
<table frame="none" pgwide="1" id="basics-dev-codes">
<title>ºÏºÐ¾÷¥N½X</title>
<tgroup cols="2">
<colspec colwidth="1*">
<colspec colwidth="5*">
<thead>
<row>
<entry>¥N½X</entry>
<entry>·N¸q</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 ¤Î¤À³Î°Ï©R¦W½d¨Ò</title>
<informaltable frame="none" pgwide="1">
<tgroup cols="2">
<colspec colwidth="1*">
<colspec colwidth="5*">
<thead>
<row>
<entry>¦WºÙ</entry>
<entry>·N¸q</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 ºÏºÐ¾÷¤º³¡°t¸m¹Ï¡C
°²³]³oӺϺЪº®e¶q¬O 4 GB¡A¨Ã¥B¥]§t¤F¨âÓ 2 GB ªº slice
(&ms-dos; ªº¤À³Î°Ï)¡C ²Ä¤@Ó slice ¬O DOS ªº
<devicename>C:</devicename> ºÏºÐ¾÷¡A²Ä¤GÓ«h¦w¸Ë¤F FreeBSD¡C
¥»½d¨Ò¤§ FreeBSD ¦³¤TÓ¤À³Î°Ï¥H¤Î¤@Ó swap ¤À³Î°Ï¡C</para>
<para>³o¤TÓ¤À³Î°Ï¨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>
¥Ø¿ýµ²ºc¡C</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>
´N¹³¬O¾ð®Ú¡A¦Ó <filename>/dev</filename>¡A<filename>/usr</filename>
¥H¤Î¨ä¥L¦b®Ú¥Ø¿ý¤Uªº¥Ø¿ý´N¹³¬O¾ðªK¡A¦Ó³o¨Ç¾ðªK¤W±¤SÁÙ¦³¤À¤ä¡A¹³¬O
<filename>/usr/local</filename> 杭C</para>
<indexterm><primary>®ÚÀɮרt²Î</primary></indexterm>
<para> ¦]¬°¬Y¨Çì¦]¡A§ÚÌ·|±N¤@¨Ç¥Ø¿ý¤À§O©ñ¦b¤£¦PªºÀɮרt²Î¤W¡C
¦p <filename>/var</filename> ¥]§t¤F¥i¯à·|º¡¥X¨Óªº
<filename>log/</filename>¡A<filename>spool/</filename>
µ¥¥Ø¿ý¥H¤Î¦U¦¡¦U¼Ëªº¼È¦sÀÉ¡C
§â®ÚÀɮרt²Î¶ë¨ìº¡¥X¨ÓÅãµM¤£¬OÓ¦n¥D·N¡A©Ò¥H§ÚÌ©¹©¹·|¤ñ¸û¶É¦V§â
<filename>/var</filename> ±q <filename>/</filename> ¤¤©Ô¥X¨Ó¡C</para>
<para>¥t¤@Ó±`¨£¨ì§â¬Y¨Ç¥Ø¿ý©ñ¦b¤£¦PÀɮרt²Î¤Wªº²z¥Ñ¬O¡G
³o¨ÇÀɮצb¤£¦Pªº¹êÅé©ÎµêÀÀºÏºÐ¾÷¤W¡C
¹³¬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µ{¤¤¦Û°Ê¦a³Q±¾¸ü
(°£«D¸ÓÀɮרt²Î¦³³Q¥[¤W <option>noauto</option> °Ñ¼Æ)¡C</para>
<para><filename>/etc/fstab</filename> Àɮפº®eªº®æ¦¡¦p¤U¡G</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>¸Ë¸m¦WºÙ (¸Ó¸Ë¸m¥²¶·¯uªº¦s¦b)¡C ¸Ô±¡½Ð°Ñ¾\
<xref linkend="disks-naming">.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>mount-point</literal></term>
<listitem><para>Àɮרt²În±¾¸ü¨ìªº¥Ø¿ý (¸Ó¥Ø¿ý¥²¶·¯uªº¦s¦b)¡C</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>fstype</literal></term>
<listitem><para>Àɮרt²ÎÃþ«¬¡A³o¬On¶Çµ¹ &man.mount.8; ªº°Ñ¼Æ¡C
FreeBSD ¹w³]ªºÀɮרt²Î¬O <literal>ufs</literal>¡C</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>options</literal></term>
<listitem>
<para> ¥iŪ¥i¼gªºÀɮרt²Î¥Î
<option>rw</option>¡A¦Ó°ßŪªºÀɮרt²Î«h¬O¥Î
<option>ro</option>¡A«á±µø»ÝnÁÙ¥i¥H¥[¨ä¥L¿ï¶µ¡C
±`¨£ªº¿ï¶µ¦p <option>noauto</option>
¬O¥Î¦b¤£n©ó¶}¾÷¹Lµ{¤¤¦Û°Êªº±¾¸üªºÀɮרt²Î¡C
¨ä¥L§ó¦hªº¿ï¶µ¥i¥H¦b &man.mount.8; ¸Ì±§ä¨ì¡C</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>dumpfreq</literal></term>
<listitem>
<para> &man.dump.8; ¥Ñ¦¹¶µ¥Ø¨M©w¨º¨ÇÀɮרt²Î»Ýn¶É¦L¡C
¦pªG³o®æªÅ¥Õ«h¥H¹s¬°¹w³]È¡C</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>passno</literal></term>
<listitem>
<para>³oÓ¶µ¥Ø¨M©wÀɮרt²ÎÀˬdªº¶¶§Ç¡C
¹ï©ón¸õ¹LÀˬdªºÀɮרt²Î¡A¥¦Ìªº <literal>passno</literal>
Èn³]¬°¹s¡C ®ÚÀɮרt²Îªº <literal>passno</literal> ÈÀ³³]¬°¤@
(¦]¬°»Ýn¤ñ©Ò¦³¨ä¥LªºÁÙn¥ýÀˬd)¡A¦Ó¨ä¥LªºÀɮרt²Îªº
<literal>passno</literal> ÈÀ³¸Ón³]±o¤ñ¤@¤j¡C
Y¦³¦hÓÀɮרt²Î¨ã¦³¬Û¦Pªº <literal>passno</literal> È¡A«h
&man.fsck.8; ·|¸ÕµÛ¥¦æ¦a(¦pªG¥i¯àªº¸Ü)Àˬd³o¨ÇÀɮר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; «ü¥O¬O®³¨Ó±¾¸üÀɮרt²Î¥Îªº¡C</para>
<para>°ò¥»ªº¾Þ§@«ü¥O®æ¦¡¦p¤U:</para>
<informalexample>
<screen>&prompt.root; <userinput>mount <replaceable>device</replaceable> <replaceable>mountpoint</replaceable></userinput></screen>
</informalexample>
<para>¦b &man.mount.8;
¸Ì±¦³´£¨ì¤@¤j°ïªº¿ï¶µ¡A¤£¹L³Ì±`¥Îªº´N¬O³o¨Ç¡G</para>
<variablelist>
<title>±¾¸ü¿ï¶µ</title>
<varlistentry>
<term><option>-a</option></term>
<listitem>
<para> §â <filename>/etc/fstab</filename>
¸Ì±©Ò¦³ÁÙ¨S¦³³Q±¾¸ü¡B¨S¦³³Q¼Ð°O¦¨ <quote>noauto</quote>
¦Ó¥B¨S¦³¥Î <option>-t</option> ±Æ°£ªºÀɮרt²Î±¾¸ü°_¨Ó¡C</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-d</option></term>
<listitem>
<para>°õ¦æ©Ò¦³ªº°Ê§@¡A¦ý¬O¤£¯uªº¥h©I¥s±¾¸üªº system call¡C
³oӿﶵ©M <option>-v</option> ·f°t®³¨Ó±À´ú &man.mount.8;
±Nn°µ¤°»ò°Ê§@®É«Ü¦n¥Î¡C</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-f</option></term>
<listitem>
<para>±j¢±¾¸ü¤£°®²bªºÀɮרt²Î (¦MÀI)¡A©Î¬O¥Î¨Ó±j¨î¨ú®ø¼g¤JÅv
(§âÀɮרt²Îªº±¾¸üª¬ºA±q¥i¦s¨úÅܦ¨°ßŪ)¡C</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-r</option></term>
<listitem>
<para>¥Î°ßŪªº¤è¦¡±¾¸üÀɮרt²Î¡C ³oӿﶵ©M¦b <option>-o</option>
¿ï¶µ¤¤«ü©w <option>ro</option> (¦b &os; 5.2¤§«eªºª©¥»¬O¥Î
<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©Î¬O¦b¦³ <option>-a</option>
¿ï¶µ®É¥u±¾¸ü«ü©w«¬ºAªºÀɮר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>Åã¥Ü¸û¸Ô²Ó¸ê°T¡C</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-w</option></term>
<listitem>
<para>¥H¥i¦s¨úªº¼Ò¦¡±¾¸üÀɮרt²Î¡C</para>
</listitem>
</varlistentry>
</variablelist>
<para> <option>-o</option>
¿ï¶µ«á±±µµÛ¥Ñ³r¸¹¤À¹jªº°Ñ¼Æ¦Cªí¡A¨Ò¦p³o¨Ç°Ñ¼Æ¡G</para>
<variablelist>
<varlistentry>
<term>nodev</term>
<listitem>
<para>¤£¸ÑªRÀɮרt²Î¤Wªº¯S®í¸Ë¸m¡A³o¬O¤@ÓÆZ¦³¥Îªº¦w¥þ¿ï¶µ¡C</para>
</listitem>
</varlistentry>
<varlistentry>
<term>noexec</term>
<listitem>
<para>¤£¤¹³\¦b³oÓÀɮרt²Î¤W°õ¦æ¤G¶i¦ìµ{¦¡½X¡A³o¤]¬O¤@ÓÆZ¦³¥Îªº¦w¥þ¿ï¶µ¡C</para>
</listitem>
</varlistentry>
<varlistentry>
<term>nosuid</term>
<listitem>
<para>¤£¸ÑªRÀɮרt²Î¤Wªº setuid ©Î setgid ºX¼Ð¡A³o¤]¬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ªº°Ñ¼Æ¥i¥H¬O±¾¸üÂI
(mountpoint)¡A¸Ë¸m¦WºÙ¡A¥H¤Î <option>-a</option> ©Î¬O
<option>-A</option> µ¥¿ï¶µ¡C</para>
<para>¥[¤W <option>-f</option> ¥i¥H±j¨î¨ø¸ü¡A¥[¤W <option>-v</option>
«h¬O·|Åã¥Ü¸Ô²Ó¸ê°T¡C nª`·Nªº¬O¤@¯ë¨Ó»¡¥Î <option>-f</option>
¨Ã¤£¬OÓ¦n¥D·N¡A±j¨î¨ø¸üÀɮרt²Î¦³¥i¯à·|³y¦¨¹q¸£·í¾÷©Î¬O·lÃaÀɮרt²Î¤ºªº¸ê®Æ¡C</para>
<para><option>-a</option> ©M <option>-A</option>
¬O¥Î¨Ó¨ø¸ü©Ò¦³¤w±¾¸üªºÀɮרt²Î¡A¥t¥~ÁÙ¥i¥H¥Î <option>-t</option>
¨Ó«ü©wn¨ø¸üªº¬Oþ¨ÇºØÃþªºÀɮרt²Î¡C nª`·Nªº¬O <option>-A</option>
¨Ã¤£·|¸Õ¹Ï¨ø¸ü®ÚÀɮרt²Î¡C</para>
</sect2>
</sect1>
<sect1 id="basics-processes">
<title>µ{§Ç</title>
<para>FreeBSD ¬O¤@Ó¦h¤uªº§@·~¨t²Î¡A¤]´N¬O»¡¦b¦P¤@®É¶¡¤º¥i¥H¶]¶W¹L¤@Óµ{¦¡¡C
¨C¤@Ó¥¿¦bªá®É¶¡¶]ªºµ{¦¡´N¥s°µ <firstterm>µ{§Ç (process)</firstterm>¡C
±z¤Uªº¨CÓ«ü¥O³£¦Ü¤Ö·|¶}±Ò¤@Ó·sªºµ{§Ç¡A¦Ó¦³¨Ç¨t²Îµ{§Ç¬O¤@ª½¦b¶]¥Hºû«ù¨t²Î¥¿±`¹B§@ªº¡C</para>
<para>¨C¤@Óµ{§Ç³£¦³¤@Ó¤£«ÂЪº¼Æ¦r¥s°µ <firstterm>process ID
</firstterm>¡A©ÎºÙ¬° <firstterm>PID
</firstterm>¡A¦Ó¥B´N¹³Àɮפ@¼Ë¡A¨C¤@Óµ{§Ç¤]¦³¾Ö¦³ªÌ¤Î¸s²Õ¡C
¾Ö¦³ªÌ¤Î¸s²Õªº¸ê°T¬O¥Î¨Ó¨M©w¤°»òÀɮשθ˸m¬O³oÓµ{§Ç¥i¥H¶}±Òªº
(«e±¦³´£¨ì¹LÀÉ®×Åv)¡C ¤j³¡¥÷ªºµ{§Ç³£¦³¤÷µ{§Ç¡C
¤÷µ{§Ç¬O¶}±Ò³oÓµ{§Çªºµ{§Ç¡A¨Ò¦p¡G±z¹ï shell ¿é¤J«ü¥O¡Ashell
¥»¨´N¬O¤@Óµ{§Ç¡A¦Ó±z°õ¦æªº«ü¥O¤]¬Oµ{§Ç¡C
¨C¤@Ó±z¥Î³oºØ¤è¦¡¶]ªºµ{§Çªº¤÷µ{§Ç³£¬O shell¡C
¦³¤@Ó¯S§Oªºµ{§Ç¥s°µ &man.init.8; ¬OÓ¨Ò¥~¡C <command>init</command>
¥Ã»·¬O²Ä¤@Óµ{§Ç¡A©Ò¥H¥Lªº PID ¤@ª½³£·|¬O 1¡C ¦b FreeBSD ¶}¾÷ªº®ÉÔ
<command>init</command> ·|¦Û°Ê¦a³Q kernel ¶}±Ò¡C</para>
<para> n¬Ý¨t²Î°õ¦æ¤¤ªºµ{§Ç¡A¦³¨âÓ¬Û·í¦³¥Îªº«ü¥O¥i¥Î¡G
&man.ps.1; ¥H¤Î &man.top.1;¡C<command>ps</command>
«ü¥O¬O¥Î¨Ó¦C¥X¥¿¦b°õ¦æ¤§µ{§Ç¡A¦Ó¥B¥i¥H¨q¥¦Ìªº
PID¡B¥Î¤F¦h¤Ö°O¾ÐÅé¡B°õ¦æªº«ü¥O¦WºÙ¤Î¨ä«á¤§°Ñ¼Æ¬O¤°»òµ¥µ¥¡C
<command>top</command>
«ü¥O«h¬OÅã¥Ü©Ò¦³¥¿¦b°õ¦æªºµ{§Ç¡A¨Ã¥B¼Æ¬íÄÁ§ó·s¤@¦¸¡C
¦]¦¹±z¥i¥H¤¬°Ê¦¡ªºÆ[¬Ý±zªº¹q¸£¥¿¦b°µ¤°»ò¡C</para>
<para>¦b¹w³]ªº±¡ªp¤U¡A<command>ps</command>
«ü¥O¥u·|¨q¥X±z©Ò¾Ö¦³ªºªºµ{§Ç¡C ¨Ò¦p¡G</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>¦b³oÓ½d¨Ò¸Ì¥i¥H¬Ý¨ì &man.ps.1; ªº¿é¥X¤À¦¨¦n´XÓÄæ¦ì¡C
<literal>PID</literal> ´N¬O«e±¦³´£¨ìªº process ID¡C PID ªº¤À°t¬O±q
1 ¶}©l¤@ª½¨ì 99999¡A¦pªG¥Î§¹ªº¸Ü¤S·|¶¦^¨Ó«ÀY¶}©l¤À°t¡C
<literal>TT</literal> Äæ¦ì¬O«ü³oÓµ{¦¡¦bþÓ tty
¤W°õ¦æ¡A¦b³o¸Ì¥i¥H¥ý©¿²¤¤£ºÞ¡C <literal>STAT</literal>
¬Oµ{¦¡ªºª¬ºA¡A¤]¥i¥H¥ý¤£nºÞ¡C <literal>TIME</literal> ¬O³oÓµ{¦¡¦b
CPU ¤W°õ¦æªº®É¶¡—
³o³q±`¤£¬Oµ{¦¡Á`¦@ªáªº®É¶¡¡A¦]¬°·í±z¶}©l°õ¦æµ{¦¡«á¡A¤j³¡¥÷ªºµ{¦¡¦b CPU
¤W°õ¦æ«e·|¥ýªá¤W¤£¤Ö®É¶¡µ¥«Ý¡C ³Ì«á¡A<literal>COMMAND</literal>
¬O°õ¦æ³oÓµ{¦¡ªº©R¥O¦C¡C</para>
<para>&man.ps.1;
¦³´XÓ¤£¦Pªº¿ï¶µ²Õ¦X¥i¥H¥Î¨ÓÅܧóÅã¥Ü¥X¨Óªº¸ê°T¡A¨ä¤¤¤@ӳ̦³¥Îªº²Õ¦X¬O
<literal>auxww</literal>¡C <option>a</option>
Åã¥Ü©Ò¦³¥¿¦b¶]ªºµ{§Çªº«ü¥O¡A¤£¥u¬O±z¦Û¤wªº¡C <option>u</option>
Åã¥Üµ{§Çªº¾Ö¦³ªÌ¦WºÙ¥H¤Î°O¾ÐÅé¨Ï¥Î±¡ªp¡C <option>x</option>
§â daemon µ{§ÇÅã¥Ü¥X¨Ó¡A¦Ó <option>ww</option> Åý &man.ps.1;
Åã¥Ü¥X§¹¾ãªº©R¥O¦C¤º®e¡A¦Ó¤£¬O°t¦X¿Ã¹õªº¼e«×Åã¥Ü¥X¸g¹L¾A«×µô°Åªº¤º®e¡C
</para>
<para> &man.top.1; ¤]¦³Ãþ¦üªº¿é¥X¡C ¤@¯ëªº±¡ªp¬Ý¹³¬O³o¼Ë¡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>¿é¥Xªº¸ê°T¤À¦¨¨âÓ³¡¥÷¡C¶}ÀY («e¤¦æ) ¨q¥X³Ìªñ¤@Óµ{§Çªº
PID¡B¨t²Î¥§¡t¸ü (¨t²Î¦³¦h¦£¿ýªº´ú¸Õ)¡B¨t²Îªº¶}¾÷®É¶¡
(±q¤W¦¸«¶}ºâ°_) ¥H¤Î²{¦bªº®É¶¡µ¥¡C
¦b¶}ÀY¸Ì±ªº¨ä¥L¼Æ¦r¤À§O¬O¦bÁ¿¦³¦h¤Öµ{§Ç¥¿¦b°õ¦æ
(¦b¥»¨Ò¤¤¬°47)¡B¦³¦h¤Ö°O¾ÐÅé¤Î swap space
³Q¥e¥Î¤F¡AÁÙ¦³´N¬O¨t²Î¤À§Oªá¤F¦h¤Ö®É¶¡¦b¤£¦Pªº CPU ª¬ºA¤W¡C</para>
<para>±µ¤U¨Óªº³¡¥÷¬O¥Ñ¦n´XÓÄæ¦ì©Òºc¦¨¡A©M &man.ps.1; ¿é¥Xªº¸ê°TÃþ¦ü¡C
´N¦p¦P«e¨Ò¡A±z¥i¥H¬Ý¨ì PID¡B¨Ï¥ÎªÌ¦WºÙ¡BCPU
ªá¶Oªº®É¶¡¥H¤Î¥¿¦b°õ¦æªº«ü¥O¡C &man.top.1;
¦b¹w³]ªº±¡ªp¤UÁÙ·|§i¶D±zµ{§Ç¥Î±¼¤F¦h¤Öªº°O¾ÐÅéªÅ¶¡¡C
¦b³oÃä·|¤À¦¨¨âÄæ¡A¤@Ó¬OÁ`¥Î¶q (total size)¡A¥t¤@Ó¬O¹ê»Ú¥Î¶q
(resident size)—Á`¥Î¶q¬O«ü³oÓÀ³¥Îµ{¦¡»Ýnªº°O¾ÐÅéªÅ¶¡¡A¦Ó¹ê»Ú¥Î¶q«h¬O«ü¹ê»Ú¤W¸Óµ{¦¡ªº°O¾ÐÅé¨Ï¥Î¶q¡C
¦b³oÓ¨Ò¤l¸Ì±±z¥i¥H¬Ý¨ì <application>&netscape;</application>
n¤F´X¥G¨ì 30 MB ªº RAM¡A¦ý¬O¥u¦³¥Î¨ì 9 MB¡C</para>
<para>&man.top.1; ¨C¹j 2 ¬íÄÁ·|¦Û°Ê§ó·sÅã¥Ü¤º®e¡A¥i¥Î <option>s</option>
¿ï¶µ¨Ó§ïÅܶ¡¹jªº®É¶¡¡C</para>
</sect1>
<sect1 id="basics-daemons">
<title>Daemon¡B«H¸¹¤Î²×¤îµ{§Ç</title>
<para>·í¦b°õ¦æ¤å®Ñ½s¿è¾¹ªº®ÉÔ¡A±z¥i¥H¥Î«Ü²³æªº¤è¦¡¾Þ§@¥¦¡An¥¦Åª¨úÀɮשάO¤°»òªº¡C
¥i¥H³o¼Ë°µ¬O¦]¬°½s¿è¾¹¦³´£¨Ñ³o¨Ç¥\¯à¡AÁÙ¦³´N¬O½s¿è¾¹¨Ìªþ¦b¤@Ó<firstterm>²×ºÝ¾÷ (Terminal)
</firstterm>¤§¤W¡C
¦³¨Çµ{¦¡¨Ã¤£¬O³]p¦¨¤@ª½¦b±µ¦¬¨Ï¥ÎªÌªº¿é¤Jªº¡A©Ò¥H¥¦Ì¦b¤@¶}©l°õ¦æªº®ÉÔ´N±q²×ºÝ¾÷Â_¶}¤F¡C
¨Ò¦p»¡¡Aºô¶¦øªA¾¹¾ã¤Ñ³£¦b¦^À³ºô¶¤è±ªºn¨D¡A¥¦³q±`¤£»Ýn±z¿é¤J¥ô¦óªF¦è¡C
¥t¥~¹³¬O§â«H±q¤@Ó¯¸¶Ç°e¨ì¥t¤@Ó¯¸ªºµ{¦¡¤]¬O³oºØÃþ«¬ªºÀ³¥Îµ{¦¡¡C</para>
<para>§Ú̧â³oºØµ{¦¡ºÙ§@ <firstterm>daemon</firstterm>¡C
Daemon (´cÅ]¡B¦uÅ@¯«)
¬O§Æþ¯«¸Ü¤¤ªº¨¤¦â¡A¥L̤£Äݩ󵽨}°}Àç©Î¨¸´c°}Àç¡A¬O¦uÅ@ªº¤pºëÆF¡C
¤jP¤W¨Ó»¡¥LÌ´N¬O¦b´À¤HÃþ°µ¤@¨Ç¦³¥Îªº¨Æ±¡¡A¸ò¤µ¤Ñªººô¶¦øªA¾¹©Î¬O¶l¥ó¦øªA¾¹«Ü¹³¡C
³o¤]´N¬O¬°¤°»ò BSD
ªº¦N²»ª«ªø´Á¥H¨Ó³£¬O¤@°¦¬ïµÛ¦|¥¬¾c®³µÛ¤T¤e¯Òªº§Ö¼Ö¤p´cÅ]
(Ķµù¡G²ßºD¥Îªk¡A¤£¥NªíÄݩ󨸴c°}Àç) ªºì¦]¡C</para>
<para>³q±`¨Ó»¡ deamon µ{¦¡ªº¦W¦r«á±³£·|¥[¤@Ó¦r¥À <quote>d</quote>¡C
<application>BIND</application> ¬O Berkeley Internet Name Daemon
ªºÁY¼g (³q±`¹ê»Ú¤W°õ¦æªºµ{¦¡¦WºÙ¬O <command>named</command>)¡BApache
ºô¶¦øªA¾¹ªºµ{¦¡¦WºÙ¬O¥s°µ
<command>httpd</command>¡B¦Lªí¾÷ªA°Èµ{¸Õ¥s
<command>lpd</command>¡A¨Ì¦¹Ãþ±À¡C
³o¬O¤@ºØ²ßºD¥Îªk¡A¨S¦³µw©Ê³W©w¡A¨Ò¦p <application>Sendmail</application>
¥Dnªº±H«H daemon ¬O¥s°µ <command>sendmail</command> ¦Ó¤£¬O
<command>maild</command>¡A¸ò±z·Q¹³ªº¤£¤@¼Ë¡C</para>
<para>¦b¦³¨Ç®ÉÔ±z·|¹J»Ýn¸ò¬YÓ daemon µ{§Ç·¾³qªº±¡ªp¡C
³o¨Ç·¾³q¬O¥Ñ<firstterm>«H¸¹ (signal) </firstterm>¨Ó¹F¦¨ªº¡C
ÂǥѰe¥X«H¸¹¡A±z¥i¥H©M¤@Ó daemon (©Î¬O¥ô¦ó¤@Ó¥¿¦b¶]ªºµ{§Ç) ·¾³q¡C
«H¸¹¦³«Ü¦hºØ—¦³¨Ç¦³¯S©wªº·N¸q¡A¦³¨Ç«h¬O·|¥ÑÀ³¥Îµ{¦¡¨Ó¸ÑŪ¡C
À³¥Îµ{¦¡ªº»¡©ú¤å¥ó·|§i¶D±z¸Óµ{¦¡¬O¦p¦ó¸ÑŪ«H¸¹ªº¡C
±z¥u¯à°e«H¸¹µ¹±z¾Ö¦³ªºµ{§Ç¡A°e &man.kill.1; ©Î &man.kill.2;
ªº«H¸¹µ¹§O¤Hªºµ{§Ç¬O¤£³Q¤¹³\ªº¡C ¤£¹L <username> root </username>
¤£¨ü¦¹¨î¡A¥L¥i¥H°e«H¸¹µ¹¥ô¦ó¤Hªºµ{§Ç¡C</para>
<para>FreeBSD ¥»¨¦b¬Y¨Ç±¡ªp¤]·|°e«H¸¹µ¹À³¥Îµ{¦¡¡C
°²³]¦³ÓÀ³¥Îµ{¦¡¼g±o«ÜÄê¡AµM«á¥ø¹Ïn¦s¨ú¥¦¤£¸Ó¸Iªº°O¾ÐÅ骺®ÉÔ¡AFreeBSD
·|°e¤@Ó <firstterm>Segmentation Violation</firstterm> «H¸¹
(<literal>SIGSEGV</literal>) µ¹³oÓµ{§Ç¡C
¤S¦pªG¦³¤@ÓÀ³¥Îµ{¦¡¥Î¤F &man.alarm.3; ªº system call
n¨D¨t²Î¦b¹L¤@¬q®É¶¡¤§«á¥s¥L¤@¤U¡A®É¶¡¨ì¤Fªº®ÉÔ¾xÄÁªº«H¸¹
(<literal>SIGALRM</literal>) ´N·|³Q°e¥X¤F¡A¨ä¥Lªº¨Ì¦¹Ãþ±À¡C</para>
<para><literal>SIGTERM</literal> and <literal>SIGKILL</literal>
³o¨âÓ«H¸¹¥i¥H®³¨Ó²×¤îµ{§Ç¡C ¥Î <literal>SIGTERM</literal>
µ²§ôµ{§Ç¬O¤ñ¸û¦³Â§»ªªº¤è¦¡¡A¸Óµ{§Ç·|<emphasis>®·®» (catch) </emphasis>
³oÓ«H¸¹¦Ó¤F¸Ñ¨ì±z·Qn§â¥LÃö±¼¡C
±µµÛ¤U¨Ó¥¦·|§â¥¦¦Û¤w¶}ªº°O¿ýÀɳq³qÃö±¼¡AµM«á¦bÃö±¼µ{§Ç¤§«eµ²§ô±¼¤âÃ䪺¤u§@¡C
¦b¬Y¨Ç±¡ªp¤Uµ{§Ç¦³¥i¯à·|¸Ë§@¨S¬Ý¨£
<literal>SIGTERM</literal>¡A°²¦p¥¦¥¿¦b°µ¤@¨Ç¤£¯à¤¤Â_ªº¤u§@ªº¸Ü¡C</para>
<para><literal>SIGKILL</literal> ´N¨S¦³¿ìªk³Qµ{§Ç©¿²¤¤F¡C
³o¬O¤@Ó<quote>§ÚºÞ§A¥¿¦b·F¹À¡A²{¦b´Nµ¹§Ú°±¤U¨Ó</quote>ªº«H¸¹¡C
¦pªG±z°e¤F <literal>SIGKILL</literal> «H¸¹µ¹¬YÓµ{§Ç¡AFreeBSD
±N·|§â¥¦°±±¼<footnote>
<para> ¤£§¹¥þ¥¿½T—ÁÙ¬O¦³¤Ö¼ÆªF¦è¤£¯à³Q¤¤Â_¡C
¨Ò¦p¦³Óµ{§Ç¥¿¦b±qºô¸ô¤Wªº§Oªº¹q¸£Åª¤@ÓÀɮסA¦Ó¨º³¡¹q¸£¦]¬°¬Y¨Ç²z¥Ñ³s¤£¨ì
(¾÷¾¹³QÃö±¼¡A©Î¬Oºô¸ôÄê±¼¤F)¡A¨º³oÓµ{§Ç§ÚÌ´N»¡¥L¬O¤@Ó<quote>¤£¯à¤¤Â_ªº</quote>µ{§Ç¡C
³q±`¦b¸g¹L¨â¤ÀÄÁ¥ª¥k¤§«á³oÓµ{§Ç·|¹O®É¡C
·íµo¥Í¹O®Éªº®ÉÔ³oÓµ{§Ç´N·|³Qµ²§ô±¼¤F¡C</para>
</footnote>¡C</para>
<para> ³o¨Ç¬O¨ä¥L±z¦³¥i¯à·|n¥Î¨ìªº«H¸¹¡G
<literal>SIGHUP</literal>¡A<literal>SIGUSR1</literal>¡A¥H¤Î
<literal>SIGUSR2</literal>¡C
³o¨Ç¬O³q¥Îªº«H¸¹¡A·í°e¥X®É¤£¦PªºÀ³¥Îµ{¦¡·|¦³¤£¦Pªº¤ÏÀ³¡C</para>
<para>°²³]±z§ó°Ê¤F±zªººô¶¦øªA¾¹ªº³]©wÀÉ—±z·Qn¥sºô¶¦øªA¾¹¥h«·sŪ¨ú³]©wÈ¡C
±z¥i¥HÃö³¬«á¦A«·s±Ò°Ê
<command>httpd</command>¡A¦ý¬O³o»ò°µ·|³y¦¨ºô¶¦øªA¾¹¼È°±ªA°È¤@¬q®É¶¡¡A³o¼Ë¤l¥i¯à¤£¤Ó¦n¡C
¤j³¡¥÷ªº daemon ³£¼g¦¨·|¥h¦^À³ <literal>SIGHUP</literal>¡C
·í¦¬¨ì³oÓ«H¸¹¤§«á¡A¥¦Ì·|¥h«·sŪ¨ú¦Û¤wªº³]©wÀÉ¡C
¦]¦¹±z¥i¥H¥Î°e <literal>SIGHUP</literal> «H¸¹¨Ó¨ú¥NÃö±¼«¶}¡C
¤S¦]¬°¨S¦³¼Ð·Ç¦b³W½d¦p¦ó¦^À³³o¨Ç«H¸¹¡A¤£¦Pªº daemon
¥i¯à·|¦³¤£¦Pªº¦æ¬°¡A©Ò¥H¦³ºÃ°Ýªº¸Ü½Ð¥ý½T»{¨Ã½¾\ deamon ªº»¡©ú¤å¥ó¡C</para>
<para>«H¸¹¬O¥Ñ &man.kill.1; «ü¥O°e¥Xªº¡A¦p½d¨Ò©Ò¥Ü¡G</para>
<procedure>
<title>°e«H¸¹µ¹µ{§Ç</title>
<para>³oÓ½d¨Ò±N·|¥Ü½d¦p¦ó°e¤@Ó«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>§ä¥X±z·Qn°e«H¸¹ªº¨ºÓµ{§Çªº ID¡C ±z·|¥Î¨ì &man.ps.1; ¥H¤Î &man.grep.1;
³o¨âÓ«ü¥O¡C &man.grep.1; ¬O¥Î¨Ó¦b¿é¥X¤¤·j´M¡A§ä¥X±z«ü©wªº¦r¦ê¡C
³oÓ«ü¥O¬O¥Ñ¤@¯ë¨Ï¥ÎªÌ°õ¦æ¡A¦Ó &man.inetd.8; ¬O¥Ñ <username>root</username>
°õ¦æ¡A©Ò¥H¦b¨Ï¥Î &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>¦]¦¹¥i±o &man.inetd.8; ¤§ PID ¬° 198¡C ¦b¬Y¨Ç±¡ªp¤U
<literal>grep inetd</literal> ³oÓ«ü¥O¥»¨¤]·|¥X²{¦b¿é¥X¸Ì¡C
³o¬O¦]¬° &man.ps.1; §ä°õ¦æ¤¤ªºµ{§Çªº¤è¦¡³y¦¨ªº¡C </para>
</step>
<step>
<para>¥Î &man.kill.1; ¨Ó°e«H¸¹¡C ¤S¦]¬° &man.inetd.8; ¬O¥Ñ
<username>root</username> °õ¦æªº¡A±z¥²¶·¥Î &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>¤@¯ë±¡ªp¹ï¤j¦h¼Æ &unix; «ü¥O¨ÓÁ¿¡A·í &man.kill.1;
°õ¦æ¦¨¥\®É¨Ã¤£·|¿é¥X¥ô¦ó°T®§¡C
°²³]±z°e¤@Ó«H¸¹µ¹¬YÓ¤£¬O±z©Ò¾Ö¦³ªºµ{§Ç¡A¨º»ò±z´N·|¦Y¨ì³oÓ¿ù»~°T®§¡G
<errorname>kill: <replaceable>PID</replaceable>: Operation not
permitted</errorname>¡C ¦Ó¦pªG±z¥´¿ù PID ªº¸Ü¡A
¨º´N·|§â«H¸¹°eµ¹¿ù»~ªºµ{§Ç¡C
¨º¥i¯à·|«ÜÁV¡A¤£¹L¦pªG±z°÷©¯¹Bªº¸Ü¡A¥i¯àè¦n´N¥u¬O§â«H¸¹°eµ¹¤@Ó«D¨Ï¥Î¤¤ªº
PID¡A¨º±z´N¥u·|¬Ý¨ì <errorname>kill:
<replaceable>PID</replaceable>: No such process</errorname>
¦Ó¤w¡C</para>
<note>
<title>¬°¤°»ò¥Î <command>/bin/kill</command>¡H</title>
<para>«Ü¦h shell ¦³´£¨Ñ¤º«Øªº <command>kill</command> «ü¥O¡C
¤]´N¬O»¡³oºØ shell ·|ª½±µ°e«H¸¹¡A¦Ó¤£¬O°õ¦æ
<filename>/bin/kill</filename>¡C
³o¼Ë¬OÆZ¤è«Kªº¨S¿ù°Õ¡A¦ý¬O¤£¦Pªº shell ·|¦³¤£¦Pªº»yªk¨Ó«ü©w«H¸¹ªº¦WºÙµ¥¡C
»P¨ä¹Á¸Õ¥h§â¥¦Ì³q³q¾Ç·|¡A¤£¦p´N³æ¯Âªºª½±µ¥Î <command>/bin/kill
<replaceable>...</replaceable></command> §a¡C</para>
</note>
</step>
</procedure>
<para>n°e¨ä¥Lªº«H¸¹ªº¸Ü¤]¬O«D±`Ãþ¦ü¡A´Nµø»Ýn§â«ü¥O¤¤ªº
<literal>TERM</literal> ©Î <literal>KILL</literal>
´À´«±¼§Y¥i¡C</para>
<important>
<para>ÀH«K§ì¤@Ó¨t²Î¤¤ªºµ{§ÇµM«á§â¥L¬å±¼¨Ã¤£¬OÓ¦n¥D·N¡C
¯S§O¬O &man.init.8;¡A process ID 1¡A¤@Ó«D±`¯S§Oªºµ{§Ç¡C
°õ¦æ <command>/bin/kill -s KILL 1</command>
ªºµ²ªG´N¬O¨t²Î¥ß¨èÃö¾÷¡C ¦]¦¹¦b±z«ö¤U <keycap>Return</keycap>
n°õ¦æ &man.kill.1;<emphasis>¤§«e</emphasis>¡A
½Ð<emphasis>¤@©w</emphasis>n°O±o¦A¦¸½T»{±z¤Uªº°Ñ¼Æ¡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 "/usr/local/bin/bash" >> /etc/shells</userinput></screen>
<para>Then rerun <command>chsh</command>.</para>
</note>
</sect2>
</sect1>
<sect1 id="editors">
<title>¤å¦r½s¿è¾¹</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 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>§ó¦h¸ê°T</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:
>Unformatted:
More information about the freebsd-doc
mailing list