Linux各目录介绍
本文中的内容主要参考http://www.tldp.org/并将其核心内容进行总结翻译,并提供对应原文给读者参考。tldp全程是The Linux Documentation Project,具有非常高的权威性。我就充当一下搬运工给需要的人士提供一些关键信息及翻译。原linux文档链接会放在标题上。为什么这么干呢?来源于我想知道/usr的含义,结果发现,可供参考的地方并不多,而且也没有很好的揭开疑惑。所以就我在tldp上看到的放到这里权当参考,不足之处多多见谅。文中多次提到的FSSTND全称为:Filesystem Hierarchy Standard。链接指向wiki。中文翻译为:文件系统层次结构标准。
The Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Linux distributions.
文件系统层次结构标准(FHS)定义Linux发行版中的目录结构和目录内容。
The Root Directory
To comply with the FSSTND the following directories, or symbolic links to directories, are required in /.
要符合FSSTND,/中需要以下目录或目录的符号链接。
/bin Essential command binaries
/boot Static files of the boot loader
/dev Device files
/etc Host-specific system configuration
/lib Essential shared libraries and kernel modules
/media Mount point for removeable media
/mnt Mount point for mounting a filesystem temporarily
/opt Add-on application software packages
/sbin Essential system binaries
/srv Data for services provided by this system
/tmp Temporary files
/usr Secondary hierarchy
/var Variable data
/bin Essential命令二进制文件
/dev 设备文件
/lib Essential 共享库和内核模块
/mnt 临时安装文件系统的挂载点
/sbin 基本系统二进制文件
/tmp 临时文件
/var 可变数据
The following directories, or symbolic links to directories, must be in /, if the corresponding subsystem is installed:
如果安装了相应的子系统,则以下目录或目录的符号链接必须位于/中:
/ -- the root directory
/home User home directories (optional)
/lib<qual> Alternate format essential shared libraries
(optional)
/root Home directory for the root user (optional)
/ - 根目录
/ lib <qual>备用格式基本共享库(可选的)
/ root root用户的主目录(可选)
/bin
Unlike /sbin, the bin directory contains several useful commands that are of use to both the system administrator as well as non-privileged users. It usually contains the shells like bash, csh, etc…. and commonly used commands like cp, mv, rm, cat, ls. For this reason and in contrast to /usr/bin, the binaries in this directory are considered to be essential. The reason for this is that it contains essential system programs that must be available even if only the partition containing / is mounted. This situation may arise should you need to repair other partitions but have no access to shared directories (ie. you are in single user mode and hence have no network access). It also contains programs which boot scripts may depend on.
与/sbin不同,bin目录包含几个对系统管理员和非特权用户都有用的有用命令。它通常包含像bash,csh等的shell ….以及常用的命令,如cp,mv,rm,cat,ls。出于这个原因,与/usr /bin相反,此目录中的二进制文件被认为是必不可少的。原因是它包含必要的系统程序,即使只安装包含/的分区也必须可用。如果您需要修复其他分区但无法访问共享目录(即您处于单用户模式,因此无法访问网络),则可能会出现这种情况。它还包含引导脚本可能依赖的程序。
Compliance to the FSSTND means that there are no subdirectories in /bin and that the following commands, or symbolic links to commands, are located there.
符合FSSTND意味着/bin中没有子目录,并且以下命令或命令的符号链接位于那里。
cat Utility to concatenate files to standard output
chgrp Utility to change file group ownership
chmod Utility to change file access permissions
chown Utility to change file owner and group
cp Utility to copy files and directories
date Utility to print or set the system data and time
dd Utility to convert and copy a file
df Utility to report filesystem disk space usage
dmesg Utility to print or control the kernel message buffer
echo Utility to display a line of text
false Utility to do nothing, unsuccessfully
hostname Utility to show or set the system's host name
kill Utility to send signals to processes
ln Utility to make links between files
login Utility to begin a session on the system
ls Utility to list directory contents
mkdir Utility to make directories
mknod Utility to make block or character special files
more Utility to page through text
mount Utility to mount a filesystem
mv Utility to move/rename files
ps Utility to report process status
pwd Utility to print name of current working directory
rm Utility to remove files or directories
rmdir Utility to remove empty directories
sed The `sed' stream edi