📄 dirstructure.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Directory Structure</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="UNIX Basics" href="basics.html" /><link rel="PREVIOUS" title="Permissions" href="permissions.html" /><link rel="NEXT" title="Disk Organization" href="disk-organization.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="permissions.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 3 UNIX Basics</td><td width="10%" align="right" valign="bottom"><a href="disk-organization.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="DIRSTRUCTURE" name="DIRSTRUCTURE">3.4 DirectoryStructure</a></h1><p>The FreeBSD directory hierarchy is fundamental to obtaining an overall understandingof the system. The most important concept to grasp is that of the root directory, ``/''.This directory is the first one mounted at boot time and it contains the base systemnecessary to prepare the operating system for multi-user operation. The root directoryalso contains mount points for every other file system that you may want to mount.</p><p>A mount point is a directory where additional file systems can be grafted onto theroot file system. Standard mount points include <tt class="FILENAME">/usr</tt>, <ttclass="FILENAME">/var</tt>, <tt class="FILENAME">/mnt</tt>, and <ttclass="FILENAME">/cdrom</tt>. These directories are usually referenced to entries in thefile <tt class="FILENAME">/etc/fstab</tt>. <tt class="FILENAME">/etc/fstab</tt> is atable of various file systems and mount points for reference by the system. Most of thefile systems in <tt class="FILENAME">/etc/fstab</tt> are mounted automatically at boottime from the script <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=rc&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rc</span>(8)</span></a> unless theycontain the <var class="OPTION">noauto</var> option. Consult the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=fstab&sektion=5"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">fstab</span>(5)</span></a> manual pagefor more information on the format of the <tt class="FILENAME">/etc/fstab</tt> file andthe options it contains.</p><p>A complete description of the file system hierarchy is available in <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=hier&sektion=7"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">hier</span>(7)</span></a>. For now, abrief overview of the most common directories will suffice.</p><p></p><div class="INFORMALTABLE"><a id="AEN3941" name="AEN3941"></a><table border="0" frame="void" class="CALSTABLE"><col /><col /><thead><tr><th>Directory</th><th>Description</th></tr></thead><tbody><tr><td><tt class="FILENAME">/</tt></td><td>Root directory of the file system.</td></tr><tr><td><tt class="FILENAME">/bin/</tt></td><td>User utilities fundamental to both single-user and multi-user environments.</td></tr><tr><td><tt class="FILENAME">/boot/</tt></td><td>Programs and configuration files used during operating system bootstrap.</td></tr><tr><td><tt class="FILENAME">/boot/defaults/</tt></td><td>Default bootstrapping configuration files; see <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=loader.conf&sektion=5"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">loader.conf</span>(5)</span></a>.</td></tr><tr><td><tt class="FILENAME">/dev/</tt></td><td>Device nodes; see <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=intro&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">intro</span>(4)</span></a>.</td></tr><tr><td><tt class="FILENAME">/etc/</tt></td><td>System configuration files and scripts.</td></tr><tr><td><tt class="FILENAME">/etc/defaults/</tt></td><td>Default system configuration files; see <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=rc&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rc</span>(8)</span></a>.</td></tr><tr><td><tt class="FILENAME">/etc/mail/</tt></td><td>Configuration files for mail transport agents such as <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=sendmail&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">sendmail</span>(8)</span></a>.</td></tr><tr><td><tt class="FILENAME">/etc/namedb/</tt></td><td><tt class="COMMAND">named</tt> configuration files; see <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=named&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">named</span>(8)</span></a>.</td></tr><tr><td><tt class="FILENAME">/etc/periodic/</tt></td><td>Scripts that are run daily, weekly, and monthly, via <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=cron&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">cron</span>(8)</span></a>; see <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=periodic&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">periodic</span>(8)</span></a>.</td></tr><tr><td><tt class="FILENAME">/etc/ppp/</tt></td><td><tt class="COMMAND">ppp</tt> configuration files; see <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=ppp&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ppp</span>(8)</span></a>.</td></tr><tr><td><tt class="FILENAME">/mnt/</tt></td><td>Empty directory commonly used by system administrators as a temporary mountpoint.</td></tr><tr><td><tt class="FILENAME">/proc/</tt></td><td>Process file system; see <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=procfs&sektion=5"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">procfs</span>(5)</span></a>, <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=mount_procfs&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">mount_procfs</span>(8)</span></a>.</td></tr><tr><td><tt class="FILENAME">/root/</tt></td><td>Home directory for the <tt class="USERNAME">root</tt> account.</td></tr><tr><td><tt class="FILENAME">/sbin/</tt></td><td>System programs and administration utilities fundamental to both single-user andmulti-user environments.</td></tr><tr><td><tt class="FILENAME">/stand/</tt></td><td>Programs used in a standalone environment.</td></tr><tr><td><tt class="FILENAME">/tmp/</tt></td><td>Temporary files, usually a <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=mfs&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">mfs</span>(8)</span></a> memory-basedfile system (the contents of <tt class="FILENAME">/tmp</tt> are usually NOT preservedacross a system reboot).</td></tr><tr><td><tt class="FILENAME">/usr/</tt></td><td>The majority of user utilities and applications.</td></tr><tr><td><tt class="FILENAME">/usr/bin/</tt></td><td>Common utilities, programming tools, and applications.</td></tr><tr><td><tt class="FILENAME">/usr/include/</tt></td><td>Standard C include files.</td></tr><tr><td><tt class="FILENAME">/usr/lib/</tt></td><td>Archive libraries.</td></tr><tr><td><tt class="FILENAME">/usr/libdata/</tt></td><td>Miscellaneous utility data files.</td></tr><tr><td><tt class="FILENAME">/usr/libexec/</tt></td><td>System daemons & system utilities (executed by other programs).</td></tr><tr><td><tt class="FILENAME">/usr/local/</tt></td><td>Local executables, libraries, etc. Also used as the default destination for theFreeBSD ports framework. Within <tt class="FILENAME">/usr/local</tt>, the general layoutsketched out by <a href="http://www.FreeBSD.org/cgi/man.cgi?query=hier&sektion=7"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">hier</span>(7)</span></a> for <ttclass="FILENAME">/usr</tt> should be used. Exceptions are the man directory, which isdirectly under <tt class="FILENAME">/usr/local</tt> rather than under <ttclass="FILENAME">/usr/local/share</tt>, and the ports documentation is in <ttclass="FILENAME">share/doc/<var class="REPLACEABLE">port</var></tt>.</td></tr><tr><td><tt class="FILENAME">/usr/obj/</tt></td><td>Architecture-specific target tree produced by building the <ttclass="FILENAME">/usr/src</tt> tree.</td></tr><tr><td><tt class="FILENAME">/usr/ports</tt></td><td>The FreeBSD ports collection (optional).</td></tr><tr><td><tt class="FILENAME">/usr/sbin/</tt></td><td>System daemons & system utilities (executed by users).</td></tr><tr><td><tt class="FILENAME">/usr/share/</tt></td><td>Architecture-independent files.</td></tr><tr><td><tt class="FILENAME">/usr/src/</tt></td><td>BSD and/or local source files.</td></tr><tr><td><tt class="FILENAME">/usr/X11R6/</tt></td><td>X11R6 distribution executables, libraries, etc (optional).</td></tr><tr><td><tt class="FILENAME">/var/</tt></td><td>Multi-purpose log, temporary, transient, and spool files.</td></tr><tr><td><tt class="FILENAME">/var/log/</tt></td><td>Miscellaneous system log files.</td></tr><tr><td><tt class="FILENAME">/var/mail/</tt></td><td>User mailbox files.</td></tr><tr><td><tt class="FILENAME">/var/spool/</tt></td><td>Miscellaneous printer and mail system spooling directories.</td></tr><tr><td><tt class="FILENAME">/var/tmp/</tt></td><td>Temporary files that are kept between system reboots.</td></tr><tr><td><tt class="FILENAME">/var/yp</tt></td><td>NIS maps.</td></tr></tbody></table></div><br /><br /></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="permissions.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="disk-organization.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Permissions</td><td width="34%" align="center" valign="top"><a href="basics.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Disk Organization</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting <<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>>.<br />For questions about this documentation, e-mail <<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>>.</small></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -