以下是中文的解释,不是特别准确,具体请参考后面的英文:
/usr 文件系统包含所有命令、库、man 页和其他一般操作中所需的不改变的文件。 /usr
不应该有一般使用中要修改的文件。这样允许此文件系统中的文件通过网络共享,这样可以更有效,因为这样节省了磁盘空间(/usr
很容易是数百兆),且易于管理(当升级应用时,只有主/usr 需要改变,而无须改变每台机器) 即使此文件系统在本地盘上,也可以只读
mount,以减少系统崩溃时文件系统的损坏。
/var 文件系统包含会改变的文件,比如 spool
目录(mail、news、打印机等用的), log文件、formatted manual pages 和暂存文件。传统上/var
的所有东西曾在 /usr 下的某个地方,但这样/usr 就不可能只读安装了。
/home 文件系统包含用户家目录,即系统上的所有实际数据。一个大的/home 可能要分为若干文件系统,需要在/home 下加一级名字,如/home/students 、/home/staff 等。
虽
然上面将不同的部分称为文件系统,但它们不必是真的分离的文件系统。如果系统是小的单用户系统,而用户希望简单化,可以很容易地放在一个文件系统中。根据
磁盘容量和不同目的所需分配的空间,目录树也可以分到不同的文件系统中。重要的是使用标准的名字,即使/var 和/usr
在同一分区上,名字/usr/lib/libc.a 和/var/adm/messages 必须能工作,例如将/var
下的文件移动到/usr/var ,并将/var 作为/usr/var 的符号连接。
Unix
文件结构根据目的来分组文件,即所有的命令在一个地方,所有的数据在另一个地方,所有的文档又在一个地方,等等。另一个方法是根据属于的程序分组文件,即
所有 Emacs
文件在一个目录中,所有TeX文件在另一个中,等等。后一种方法的问题是文件难于共享(程序目录经常同时包含静态可共享的和动态不可共享的文件),有时难
于查找 (例如 man 页在极大数量的地方,使 man 程序查找它们极其困难)。
根文件系统
根文件系统一般应该比较小,因为包括严格的文件和一个小的不经常改变的文件系统不容易损坏。损坏的根文件系统一般意味着除非用特定的方法(例如从软盘)系统无法引导。
根目录一般不含任何文件,除了可能的标准的系统引导映象,通常叫/vmlinuz 。所有其他文件在根文件系统的子目录中。
/bin
引导启动所需的命令或普通用户可能用的命令(可能在引导启动后)。
/sbin
类似/bin ,但不给普通用户使用,虽然如果必要且允许时可以使用。
/etc
特定机器的配置文件。
/root
root用户的家目录。
/lib
根文件系统上的程序所需的共享库。
/lib/modules
核心可加载模块,特别是那些恢复损坏系统时引导所需的(例如网络和文件系统驱动)。
/dev
设备文件。
/tmp
临时文件。引导启动后运行的程序应该使用/var/tmp ,而不是/tmp ,因为前者可能在一个拥有更多空间的磁盘上。
/boot
引导加载器(bootstrap loader)使用的文件,如LILO。核心映象也经常在这里,而不是在根目录。如果有许多核心映象,这个目录可能变得很大,这时可能使用单独的文件系统更好。另一个理由是要确保核心映象必须在IDE硬盘的前1024柱面内。
/mnt
系统管理员临时 mount 的安装点。程序并不自动支持安装到/mnt 。 /mnt 可以分为子目录(例如/mnt/dosa 可能是使用 MSDOS 文件系统的软驱,而/mnt/exta 可能是使用 ext2 文件系统的软驱)。
/proc , /usr , /var , /home
其他文件系统的安装点。
/etc目录
/etc 目录包含很多文件。许多网络配置文件也在/etc 中。
/etc/rc or /etc/rc.d or /etc/rc*.d
启动、或改变运行级时运行的scripts或scripts的目录。
/etc/passwd
用户数据库,其中的域给出了用户名、真实姓名、家目录、加密的口令和用户的其他信息。
/etc/fdprm
软盘参数表。说明不同的软盘格式。用setfdprm 设置。
/etc/fstab
启动时 mount -a 命令(在/etc/rc 或等效的启动文件中)自动 mount 的文件系统列表。 Linux 下,也包括用 swapon -a 启用的 swap 区的信息。
/etc/group
类似/etc/passwd ,但说明的不是用户而是组。
/etc/inittab
init 的配置文件。
/etc/issue
getty 在登录提示符前的输出信息。通常包括系统的一段短说明或欢迎信息。内容由系统管理员确定。
/etc/magic
file 的配置文件。包含不同文件格式的说明,file 基于它猜测文件类型。
/etc/motd
Message Of The Day,成功登录后自动输出。内容由系统管理员确定。经常用于通告信息,如计划关机时间的警告。
/etc/mtab
当前安装的文件系统列表。由 scripts 初始化,并由 mount 命令自动更新。需要一个当前安装的文件系统的列表时使用,例如 df 命令。
/etc/shadow
在安装了影子口令软件的系统上的影子口令文件。影子口令文件将/etc/passwd 文件中的加密口令移动到/etc/shadow 中,而后者只对 root 可读。这使破译口令更困难。
/etc/login.defs
login 命令的配置文件。
/etc/printcap
类似/etc/termcap ,但针对打印机。语法不同。
/etc/profile , /etc/csh.login , /etc/csh.cshrc
登录或启动时 Bourne 或 C shells 执行的文件。这允许系统管理员为所有用户建立全局缺省环境。
/etc/securetty
确认安全终端,即哪个终端允许 root 登录。一般只列出虚拟控制台,这样就不可能(至少很困难)通过 modem 或网络闯入系统并得到超级用户特权。
/etc/shells
列出可信任的 shell。chsh 命令允许用户在本文件指定范围内改变登录shell。提供一台机器FTP服务的服务进程 ftpd 检查用户 shell 是否列在 /etc/shells 文件中,如果不是将不允许该用户登录。
/etc/termcap
终端性能数据库。说明不同的终端用什么"转义序列"控制。写程序时不直接输出转义序列(这样只能工作于特定品牌的终端),而是从/etc/termcap 中查找要做的工作的正确序列。这样,多数的程序可以在多数终端上运行。
/dev目录
/dev 目录包括所有设备的设备文件。设备文件用特定的约定命名。
/usr文件系统
/usr 文件系统经常很大,因为所有程序安装在这里。 /usr 里的所有文件一般来自 Linux distribution;本地安装的程序和其他东西在/usr/local 下。这样可能在升级新版系统或新 distribution 时无须重新安装全部程序。
/usr/X11R6
X Window系统的所有文件。为简化X的开发和安装,X的文件没有集成到系统中。 X自己在/usr/X11R6 下类似/usr 。
/usr/X386
类似/usr/X11R6 ,但是给 X11 Release 5 的。
/usr/bin
几乎所有用户命令。有些命令在/bin 或/usr/local/bin 中。
/usr/sbin
根文件系统不必要的系统管理命令,例如多数服务程序。
/usr/man , /usr/info , /usr/doc
手册页、GNU信息文档和各种其他文档文件。
/usr/include
C编程语言的头文件。为了一致性这实际上应该在/usr/lib 下,但传统上支持这个名字。
/usr/lib
程序或子系统的不变的数据文件,包括一些 site-wide 配置文件。名字 lib 来源于库(library); 编程的原始库存在/usr/lib 里。
/usr/local
本地安装的软件和其他文件放在这里。
/var文件系统
/var 包括系统一般运行时要改变的数据。每个系统是特定的,即不通过网络与其他计算机共享。
/var/catman
当
要求格式化时的 man 页的 cache。man 页的源文件一般存在/usr/man/man* 中;有些 man
页可能有预格式化的版本,存在/usr/man/cat* 中。而其他的 man页在第一次看时需要格式化,格式化完的版本存在/var/man
中,这样其他人再看相同的页时就无须等待格式化了。 (/var/catman 经常被清除,就象清除临时目录一样。)
/var/lib
系统正常运行时要改变的文件。
/var/local
/usr/local 中安装的程序的可变数据(即系统管理员安装的程序)。注意,如果必要,即使本地安装的程序也会使用其他/var 目录,例如/var/lock 。
/var/lock
锁定文件。许多程序遵循在/var/lock 中产生一个锁定文件的约定,以支持他们正在使用某个特定的设备或文件。其他程序注意到这个锁定文件,将不试图使用这个设备或文件。
/var/log
各
种程序的 Log 文件,特别是 login (/var/log/wtmp log 所有到系统的登录和注销) 和 syslog
(/var/log/messages 里存储所有核心和系统程序信息。 /var/log 里的文件经常不确定地增长,应该定期清除。
/var/run
保存到下次引导前有效的关于系统的信息文件。例如, /var/run/utmp 包含当前登录的用户的信息。
/var/spool
mail, news, 打印队列和其他队列工作的目录。每个不同的 spool 在/var/spool 下有自己的子目录,例如,用户的邮箱在/var/spool/mail 中。
/var/tmp
比/tmp 允许的大或需要存在较长时间的临时文件。 (虽然系统管理员可能不允许/var/tmp 有很旧的文件。)
/proc文件系统
/proc 文件系统是一个假的文件系统。它不存在在磁盘某个磁盘上。而是由核心在内存中产生。用于提供关于系统的信息(originally about processes, hence the name)。下面说明一些最重要的文件和目录。
/proc/1
关于进程1的信息目录。每个进程在/proc 下有一个名为其进程号的目录。
/proc/cpuinfo
处理器信息,如类型、制造商、型号和性能。
/proc/devices
当前运行的核心配置的设备驱动的列表。
/proc/dma
显示当前使用的DMA通道。
/proc/filesystems
核心配置的文件系统。
/proc/interrupts
显示使用的中断,and how many of each there have been.
/proc/ioports
当前使用的I/O端口。
/proc/kcore
系统物理内存映象。与物理内存大小完全一样,但不实际占用这么多内存;it is generated on the fly as programs access it. (记住:除非你把它拷贝到什么地方,/proc 下没有任何东西占用任何磁盘空间。)
/proc/kmsg
核心输出的消息。也被送到 syslog 。
/proc/ksyms
核心符号表。
/proc/loadavg
系统"平均负载";3 个指示器指出系统当前的工作量。
/proc/meminfo
存储器使用信息,包括物理内存和 swap。
/proc/modules
当前加载了哪些核心模块。
/proc/net
网络协议状态信息。
/proc/self
到查看/proc 的程序的进程目录的符号连接。当2个进程查看/proc 时,是不同的连接。这主要便于程序得到它自己的进程目录。
/proc/stat
系统的不同状态,such as the number of page faults since the system was booted.
/proc/uptime
系统启动的时间长度。
/proc/version
核心版本。
英文资料:
可以使用man hier 查看的。
/ This is the root directory. This is where the whole tree starts.
/bin This directory contains executable programs which are needed in single user mode and to bring the system up or repair it.
单用户模式需要使用的命令,多用于启动,修复系统。
/boot Contains static files for the boot loader. This directory only holds the files which are needed during the boot process. The map installer
and configuration files should go to /sbin and /etc.
引导加载器(bootstrap loader)使用的文件,如LILO。核心映象也经常在这里,而不是在根目录。如果有许多核心映象,这个目录可能变得很大,这时可能使用单独的文件系统更好。另一个理由是要确保核心映象必须在IDE硬盘的前1024柱面内。
/dev Special or device files, which refer to physical devices. See mknod(1).
/dev 目录包括所有设备的设备文件。设备文件用特定的约定命名。
/dos If both MS-DOS and Linux are run on one computer, this is a typical place to mount a DOS file system.
DOS 文件
/etc Contains configuration files which are local to the machine. Some larger software packages, like X11, can have their own subdirectories
below /etc. Site-wide configuration files may be placed here or in /usr/etc. Nevertheless, programs should always look for these files in
/etc and you may have links for these files to /usr/etc.
特定机器的配置文件。
/etc/opt
Host-specific configuration files for add-on applications installed in /opt.
添加的应用程序的配置文件
/etc/sgml
This directory contains the configuration files for SGML and XML (optional).
/etc/skel
When a new user account is created, files from this directory are usually copied into the user\u2019s home directory.
/etc/X11
Configuration files for the X11 window system (optional).
/home On machines with home directories for users, these are usually beneath this directory, directly or not. The structure of this directory
depends on local administration decisions.
/lib This directory should hold those shared libraries that are necessary to boot the system and to run the commands in the root filesystem.
/mnt This directory contains mount points for temporarily mounted filesystems
/opt This directory should contain add-on packages that contain static files.
应用程序目录
/proc This is a mount point for the proc filesystem, which provides information about running processes and the kernel. This pseudo-file system
is described in more detail in proc(5).
/root This directory is usually the home directory for the root user (optional).
/sbin Like /bin, this directory holds commands needed to boot the system, but which are usually not executed by normal users.
系统启动必须丹用户会呢少使用的命令
/tmp This directory contains temporary files which may be deleted with no notice, such as by a regular job or at system boot up.
/usr This directory is usually mounted from a separate partition. It should hold only sharable, read-only data, so that it can be mounted by
various machines running Linux.
/usr/X11R6
The X-Window system, version 11 release 6 (optional).
/usr/X11R6/bin
Binaries which belong to the X-Windows system; often, there is a symbolic link from the more traditional /usr/bin/X11 to here.
/usr/X11R6/lib
Data files associated with the X-Windows system.
/usr/X11R6/lib/X11
These contain miscellaneous files needed to run X; Often, there is a symbolic link from /usr/lib/X11 to this directory.
/usr/X11R6/include/X11
Contains include files needed for compiling programs using the X11 window system. Often, there is a symbolic link from /usr/include/X11 to
this directory.
/usr/bin
This is the primary directory for executable programs. Most programs executed by normal users which are not needed for booting or for
repairing the system and which are not installed locally should be placed in this directory.
/usr/bin/X11
is the traditional place to look for X11 executables; on Linux, it usually is a symbolic link to /usr/X11R6/bin.
/usr/dict
Replaced by /usr/share/dict.
/usr/doc
Replaced by /usr/share/doc.
/usr/etc
Site-wide configuration files to be shared between several machines may be stored in this directory. However, commands should always refer-
ence those files using the /etc directory. Links from files in /etc should point to the appropriate files in /usr/etc.
/usr/games
Binaries for games and educational programs (optional).
/usr/include
Include files for the C compiler.
/usr/include/X11
Include files for the C compiler and the X-Windows system. This is usually a symbolic link to /usr/X11R6/include/X11.
/usr/include/asm
Include files which declare some assembler functions. This used to be a symbolic link to /usr/src/linux/include/asm.
/usr/include/linux
This contains information which may change from system release to system release and used to be a symbolic link to
/usr/src/linux/include/linux to get at operating system specific information.
(Note that one should have include files there that work correctly with the current libc and in user space. However, Linux kernel source is
not designed to be used with user programs and does not know anything about the libc you are using. It is very likely that things will break
if you let /usr/include/asm and /usr/include/linux point at a random kernel tree. Debian systems don\u2019t do this and use headers from a known
good kernel version, provided in the libc*-dev package.)
/usr/include/g++
Include files to use with the GNU C++ compiler.
/usr/lib
Object libraries, including dynamic libraries, plus some executables which usually are not invoked directly. More complicated programs may
have whole subdirectories there.
/usr/lib/X11
The usual place for data files associated with X programs, and configuration files for the X system itself. On Linux, it usually is a sym-
bolic link to /usr/X11R6/lib/X11.
/usr/lib/gcc-lib
contains executables and include files for the GNU C compiler, gcc(1).
/usr/lib/groff
Files for the GNU groff document formatting system.
/usr/lib/uucp
Files for uucp(1).
/usr/local
This is where programs which are local to the site typically go.
/usr/local/bin
Binaries for programs local to the site.
/usr/local/doc
Local documentation.
/usr/local/etc
Configuration files associated with locally installed programs.
/usr/local/games
Binaries for locally installed games.
/usr/local/lib
Files associated with locally installed programs.
/usr/local/include
Header files for the local C compiler.
/usr/local/info
Info pages associated with locally installed programs.
/usr/local/man
Man pages associated with locally installed programs.
/usr/local/sbin
Locally installed programs for system administration.
/usr/local/share
Local application data that can be shared among different architectures of the same OS.
/usr/local/src
Source code for locally installed software.
/usr/man
Replaced by /usr/share/man.
/usr/sbin
This directory contains program binaries for system administration which are not essential for the boot process, for mounting /usr, or for
system repair.
/usr/share
This directory contains subdirectories with specific application data, that can be shared among different architectures of the same OS.
Often one finds stuff here that used to live in /usr/doc or /usr/lib or /usr/man.
/usr/share/dict
Contains the word lists used by spell checkers.
/usr/share/doc
Documentation about installed programs.
/usr/share/games
Static data files for games in /usr/games.
/usr/share/info
Info pages go here.
/usr/share/locale
Locale information goes here.
Often one finds stuff here that used to live in /usr/doc or /usr/lib or /usr/man.
/usr/share/dict
Contains the word lists used by spell checkers.
/usr/share/doc
Documentation about installed programs.
/usr/share/games
Static data files for games in /usr/games.
/usr/share/info
Info pages go here.
/usr/share/locale
Locale information goes here.
/usr/share/man
Manpages go here in subdirectories according to the man page sections.
/usr/share/man//man[1-9]
These directories contain manual pages for the specific locale in source code form. Systems which use a unique language and code set for all
manual pages may omit the substring.
/usr/share/misc
Miscellaneous data that can be shared among different architectures of the same OS.
/usr/share/nls
The message catalogs for native language support go here.
/usr/share/sgml
Files for SGML and XML.
/usr/share/terminfo
The datebase for terminfo.
/usr/share/tmac
Troff macros that are not distributed with groff.
/usr/share/zoneinfo
Files for timezone information.
/usr/src
Source files for different parts of the system, included with some packages for reference purposes. Don\u2019t work here with your own projects,
as files below /usr should be read-only except when installing software.
/usr/src/linux
This was the traditional place for the kernel source. Some distributions put
/usr/tmp
Obsolete. This should be a link to /var/tmp. This link is present only for compatibility reasons and shouldn\u2019t be used.
/var This directory contains files which may change in size, such as spool and log files.
/var/adm
This directory is superseded by /var/log and should be a symbolic link to /var/log.
/var/backups
Reserved for historical reasons.
/var/cache
Data cached for programs.
/var/catman/cat[1-9] or /var/cache/man/cat[1-9]
These directories contain preformatted manual pages according to their man page section. (The use of preformatted manual pages is depre-
cated.)
/var/cron
Reserved for historical reasons.
/var/lib
Variable state information for programs.
/var/local
Variable data for /usr/local.
/var/lock
Lock files are placed in this directory. The naming convention for device lock files is LCK.. where is the device\u2019s name
in the filesystem. The format used is that of HDU UUCP lock files, i.e. lock files contain a PID as a 10-byte ASCII decimal number, fol-
lowed by a newline character.
/var/log
Miscellaneous log files.
/var/opt
Variable data for /opt.
/var/mail
Users\u2019 mailboxes. Replaces /var/spool/mail.
/var/msgs
Reserved for historical reasons.
/var/preserve
Reserved for historical reasons.
/var/run
Run-time variable files, like files holding process identifiers (PIDs) and logged user information (utmp). Files in this directory are usu-
ally cleared when the system boots.
运行时文件
/var/spool
Spooled (or queued) files for various programs.
/var/spool/at
Spooled jobs for at(1).
/var/spool/cron
Spooled jobs for cron(1).
/var/spool/lpd
Spooled files for printing.
/var/spool/mail
Replaced by /var/mail.
/var/spool/mqueue
Queued outgoing mail.
/var/spool/news
Spool directory for news.
/var/spool/rwho
Spooled files for rwhod(8).
/var/spool/smail
Spooled files for the smail(1) mail delivery program.
/var/spool/uucp
Spooled files for uucp(1).
/var/tmp
Like /tmp, this directory holds temporary files stored for an unspecified duration.
/var/yp
Database files for NIS.
阅读(3358) | 评论(5) | 转发(2) |