本文主要用于解释Unix-like OS中根目录下各个路径的用途。
根目录下必须要有的路径:
-
binEssential user command binaries (for use by all users) -
bootStatic files of the boot loader
/boot stores data that is used before the kernel begins executing user-mode programs. -
devDevice files -
etcHost-specific system configuration
A "configuration file" is a local file used to control the operation of a program; it must be static.-
/etc/optConfiguration files for /opt
Host-specific configuration files for add-on application software packages must be installed within the directory /etc/opt/<subdir>
-
-
libEssential shared libraries and kernel modules -
mediaMount point for removable media -
mntMount point for mounting a filesystem temporarily -
optAdd-on application software packages -
runData relevant to running processes
This directory contains system information data describing the system since it was booted (like PID files). Files under this directory must be cleared (removed or truncated as appropriate) at the beginning of the boot process. -
sbinEssential system binaries
Utilities used for system administration (and other root-only commands) are stored in /sbin, /usr/sbin, and /usr/local/sbin.
/sbin contains binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin.
Programs executed after /usr is known to be mounted (when there are no problems) are generally placed into /usr/sbin.
Locally-installed system administration programs should be placed into /usr/local/sbin. -
srvData for services provided by this system -
tmpTemporary files
Programs must not assume that any files or directories in /tmp are preserved between invocations of the program. -
usrSecondary hierarchy
/usr is shareable, read-only data. Any information that is host-specific or varies with time is stored elsewhere.-
/usr/binPrimary directory of executable commands on the system. -
/usr/includeThis is where all of the system's general-use include files for the C programming language should be placed. -
/usr/libLibraries for programming and packages.
/usr/lib includes object files and libraries.
Applications may use a single subdirectory under /usr/lib. If an application uses a subdirectory, all architecture-dependent data exclusively used by the application must be placed within that subdirectory. -
/usr/lib<qual>(optional) Alternate format libraries
/usr/lib<qual> performs the same role as /usr/lib for an alternate binary format -
/usr/localLocal hierarchy
Used to install software locally. It needs to be safe from being overwritten when the system software is updated.
Locally installed software must be placed within /usr/local rather than /usr unless it is being installed to replace or upgrade software in /usr.-
/usr/local/binLocal binaries -
/usr/local/etcHost-specific system configuration for local binaries -
/usr/local/gamesLocal game binaries -
/usr/local/includeLocal C header files -
/usr/local/libLocal libraries -
/usr/local/manLocal online manuals -
/usr/local/sbinLocal system binaries -
/usr/local/shareLocal architecture-independent hierarchy -
/usr/local/srcLocal source code
-
-
/usr/sbinNon-essential standard system binaries used exclusively by the system administrator. -
/usr/shareArchitecture-independent data
This hierarchy is intended to be shareable among all architecture platforms of a given OS; thus, for example, a site with i386, Alpha, and PPC platforms might maintain a single /usr/share directory that is centrally-mounted.
Note, however, that /usr/share is generally not intended to be shared by different OSes or by different releases of the same OS.-
/usr/share/manManual pages -
/usr/share/miscMiscellaneous architecture-independent data
ascii :ASCII character set table (optional)
termcap.db (optional):Terminal capability database
-
-
-
varVariable data files
/var is specified here in order to make it possible to mount /usr read-only. Everything that once went into /usr that is written to during system operation (as opposed to installation and software maintenance) must be in /var.-
/var/cacheApplication cache data -
/var/libVariable state information
State information is data that programs modify while they run, is generally used to preserve the condition of an application between invocations and between different instances of the same application. -
/var/localVariable data for /usr/local -
/var/lockLock files for devices and other resources shared by multiple applications -
/var/logLog files and directories -
/var/optVariable data for /opt -
/var/runData relevant to running processes
The functions of this directory have been moved to /run.
This directory exists to ensure compatibility with systems and software using an older version of this specification. -
/var/spoolApplication spool data
Contains data which is awaiting some kind of later processing. Data in /var/spool represents work to be done in the future (by a program, user, or administrator); often data is deleted after it has been processed. -
/var/tmpTemporary files preserved between system reboots
For programs that require temporary files or directories that are preserved between system reboots. Therefore, data stored in /var/tmp is more persistent than data in /tmp.
-
根目录下的可选路径:
-
homeUser home directories (optional) -
lib<qual>Alternate format essential shared libraries (optional) -
rootHome directory for the root user (optional)










网友评论