📄 systemdirs.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><HTML><HEAD><TITLE>Important System Directories</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="Advanced Bash-Scripting Guide"HREF="index.html"><LINKREL="PREVIOUS"TITLE=" Important Files"HREF="files.html"><LINKREL="NEXT"TITLE="Localization"HREF="localization.html"><METAHTTP-EQUIV="Content-Style-Type"CONTENT="text/css"><LINKREL="stylesheet"HREF="common/kde-common.css"TYPE="text/css"><METAHTTP-EQUIV="Content-Type"CONTENT="text/html; charset=iso-8859-1"><METAHTTP-EQUIV="Content-Language"CONTENT="en"><LINKREL="stylesheet"HREF="common/kde-localised.css"TYPE="text/css"TITLE="KDE-English"><LINKREL="stylesheet"HREF="common/kde-default.css"TYPE="text/css"TITLE="KDE-Default"></HEAD><BODYCLASS="APPENDIX"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#AA0000"VLINK="#AA0055"ALINK="#AA0000"STYLE="font-family: sans-serif;"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Advanced Bash-Scripting Guide: An in-depth exploration of the art of shell scripting</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="files.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="localization.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="APPENDIX"><H1><ANAME="SYSTEMDIRS"></A>Appendix H. Important System Directories</H1><P>Sysadmins and anyone else writing administrative scripts should be intimately familiar with the following system directories.</P><UL><LI><P><TTCLASS="FILENAME">/bin</TT></P><P>Binaries (executables). Basic system programs and utilities (such as <BCLASS="COMMAND">bash</B>).</P></LI><LI><P><TTCLASS="FILENAME">/usr/bin</TT> <ANAME="AEN21789"HREF="#FTN.AEN21789">[1]</A> </P><P>More system binaries.</P></LI><LI><P><TTCLASS="FILENAME">/usr/local/bin</TT></P><P>Miscellaneous binaries local to the particular machine.</P></LI><LI><P><TTCLASS="FILENAME">/sbin</TT></P><P>System binaries. Basic system administrative programs and utilities (such as <BCLASS="COMMAND">fsck</B>).</P></LI><LI><P><TTCLASS="FILENAME">/usr/sbin</TT></P><P>More system administrative programs and utilities.</P></LI><LI><P><TTCLASS="FILENAME">/etc</TT></P><P><ICLASS="FIRSTTERM">Et cetera</I>. Systemwide configuration scripts.</P><P>Of particular interest are the <TTCLASS="FILENAME">/etc/fstab</TT> (filesystem table), <TTCLASS="FILENAME">/etc/mtab</TT> (mounted filesystem table), and the <AHREF="system.html#INITTABREF"><TTCLASS="FILENAME">/etc/inittab</TT></A> files.</P></LI><LI><P><TTCLASS="FILENAME">/etc/rc.d</TT></P><P>Boot scripts, on Red Hat and derivative distributions of Linux.</P></LI><LI><P><TTCLASS="FILENAME">/usr/share/doc</TT></P><P>Documentation for installed packages.</P></LI><LI><P><TTCLASS="FILENAME">/usr/man</TT></P><P>The systemwide <AHREF="external.html#MANREF">manpages</A>.</P></LI><LI><P><TTCLASS="FILENAME">/dev</TT></P><P>Device directory. Entries (but <SPANCLASS="emphasis"><ICLASS="EMPHASIS">not</I></SPAN> mount points) for physical and virtual devices. See <AHREF="devproc.html">Chapter 27</A>.</P></LI><LI><P><TTCLASS="FILENAME">/proc</TT></P><P>Process directory. Contains information and statistics about running processes and kernel parameters. See <AHREF="devproc.html">Chapter 27</A>.</P></LI><LI><P><TTCLASS="FILENAME">/sys</TT></P><P>Systemwide device directory. Contains information and statistics about device and device names. This is newly added to Linux with the 2.6.X kernels.</P></LI><LI><P><TTCLASS="FILENAME">/mnt</TT></P><P><ICLASS="FIRSTTERM">Mount</I>. Directory for mounting hard drive partitions, such as <TTCLASS="FILENAME">/mnt/dos</TT>, and physical devices. In newer Linux distros, the <TTCLASS="FILENAME">/media</TT> directory has taken over as the preferred mount point for I/O devices.</P></LI><LI><P><TTCLASS="FILENAME">/media</TT></P><P>In newer Linux distros, the preferred mount point for I/O devices, such as CD/DVD drives or USB flash drives.</P></LI><LI><P><TTCLASS="FILENAME">/var</TT></P><P><ICLASS="FIRSTTERM">Variable</I> (changeable) system files. This is a catchall <SPANCLASS="QUOTE">"scratchpad"</SPAN> directory for data generated while a Linux/UNIX machine is running.</P></LI><LI><P><TTCLASS="FILENAME">/var/log</TT></P><P>Systemwide log files.</P></LI><LI><P><TTCLASS="FILENAME">/var/spool/mail</TT></P><P>User mail spool.</P></LI><LI><P><TTCLASS="FILENAME">/lib</TT></P><P>Systemwide library files.</P></LI><LI><P><TTCLASS="FILENAME">/usr/lib</TT></P><P>More systemwide library files.</P></LI><LI><P><TTCLASS="FILENAME">/tmp</TT></P><P>System temporary files.</P></LI><LI><P><TTCLASS="FILENAME">/boot</TT></P><P>System <ICLASS="FIRSTTERM">boot</I> directory. The kernel, module links, system map, and boot manager reside here.</P><DIVCLASS="WARNING"><TABLECLASS="WARNING"WIDTH="90%"BORDER="0"><TR><TDWIDTH="25"ALIGN="CENTER"VALIGN="TOP"><IMGSRC="common/warning.png"HSPACE="5"ALT="Warning"></TD><TDALIGN="LEFT"VALIGN="TOP"><P>Altering files in this directory may result in an unbootable system.</P></TD></TR></TABLE></DIV></LI></UL></DIV><H3CLASS="FOOTNOTES">Notes</H3><TABLEBORDER="0"CLASS="FOOTNOTES"WIDTH="100%"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="5%"><ANAME="FTN.AEN21789"HREF="systemdirs.html#AEN21789">[1]</A></TD><TDALIGN="LEFT"VALIGN="TOP"WIDTH="95%"><P>Some early UNIX systems had a fast, small-capacity fixed disk (containing <TTCLASS="FILENAME">/</TT>, the root partition), and a second drive which was larger, but slower (containing <TTCLASS="FILENAME">/usr</TT> and other partitions). The most frequently used programs and utilities therefore resided on the small-but-fast drive, in <TTCLASS="FILENAME">/bin</TT>, and the others on the slower drive, in <TTCLASS="FILENAME">/usr/bin</TT>.</P><P>This likewise accounts for the split between <TTCLASS="FILENAME">/sbin</TT> and <TTCLASS="FILENAME">/usr/sbin</TT>, <TTCLASS="FILENAME">/lib</TT> and <TTCLASS="FILENAME">/usr/lib</TT>, etc.</P></TD></TR></TABLE><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="files.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="index.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="localization.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Important Files</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"> </TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Localization</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -