码迷,mamicode.com
首页 > 其他好文 > 详细

Filesystem-Hierarchy-Standard(FHS) 文件系统层次结构标准2.3中英对照版(未完待续)

时间:2014-12-29 09:00:04      阅读:450      评论:0      收藏:0      [点我收藏+]

标签:

本想把原文翻译一遍,一来学习学习Linux的文件系统结构,二来熟悉下专业英语。经历了一个月之久,才翻译到一半。再也没有空闲时间待在学校了,不知道什么时间才能翻译完。先在这里发表一下,给有需要的同志们方便学习,也给自己一个提醒,告诉自己这里还有一件未完成的事。。感謝大家支持

--------------------------------------以下是FHS-2.3正文内容-----------------------------------------------

Filesystem Hierarchy Standard文件系统层次结构标准

Filesystem Hierarchy Standard Group文件系统层次结构标准组

Edited by

Rusty Russell

Daniel Quinlan

Christopher Yeoh

Copyright ? 1994-2004 Daniel Quinlan

Copyright ? 2001-2004 Paul ‘Rusty‘ Russell

Copyright ? 2003-2004 Christopher Yeoh

This standard consists of a set ofrequirements and guidelines for file and directory placement under UNIX-likeoperating systems. The guidelines are intended to support interoperability ofapplications, system administration tools, development tools, and scripts aswell as greater uniformity of documentation for these systems.

这个标准由一组在类UNIX操作系统下的文件和目录如何放置的要求和指南构成。这些指南的目的在于支持这些系统上的应用程序、系统管理工具、开发工具、脚本以及通用文档等之间的互通性。

All trademarks and copyrights are ownedby their owners, unless specifically noted otherwise. Use of a term in thisdocument should not be regarded as affecting the validity of any trademark orservice mark.

除非明确指出,所有的商标权和版权属于他们的拥有者。使用本文中的术语不应该被视为影响任何商标或服务标识的有效性。

Permission is granted to make and distribute verbatim copiesof this standard provided the copyright and this permission notice arepreserved on all copies.

允许制作和分发本标准的完整副本,前提是要求在所有副本上保留此版权和许可声明。

Permission is granted to copy and distribute modifiedversions of this standard under the conditions for verbatim copying, providedalso that the title page is labeled as modified including a reference to theoriginal standard, provided that information on retrieving the originalstandard is included, and provided that the entire resulting derived work isdistributed under the terms of a permission notice identical to this one.

在满足以下条件的情况下,允许拷贝和分发本标准修改后的版本:1.必须是逐字(全部)拷贝;2. 要求在标题页上标明“已修改”并标明引用了本标准;3. 要包含如何取回本标准的信息;4. 所有的衍生的工作成果要按照本标准的许可声明进行发布。

Permission is granted to copy and distribute translationsof this standard into another language, under the above conditions for modifiedversions, except that this permission notice may be stated in a translationapproved by the copyright holder.

在满足上述修改的版本的条件下,允许将本标准拷贝并分发翻译成其他语言的版本。有一点特殊的要求,许可声明的翻译需要经过版权持有人的同意。


Table of Contents

1. Introduction简介

Purpose意图

Conventions约定

2. TheFilesystem文件系统

3. TheRoot Filesystem根文件系统

Purpose目的

Requirements要求

Specific Options特定选项

/bin : Essential usercommand binaries (for use by all users)/bin:必需的用户命令文件(所有的用户都使用)

Purpose目的

Requirements要求

Specific Options特定选项

/boot : Static files of theboot loader/boot:启动加载器的静态文件

Purpose目的

Specific Options特定选项

/dev : Device files/dev:设备文件

Purpose目的

Specific Options特定选项

/etc : Host-specificsystem configuration/etc:特定主机的系统配置

Purpose目的

Requirements要求

Specific Options特定选项

/etc/opt : Configurationfiles for /opt/etc/opt:/opt的配置文件

/etc/X11 : Configurationfor the X Window System (optional)/etc/X11:X窗口系统的配置(可选)

/etc/sgml :Configuration files for SGML (optional)/etc/sgml:SGML的配置文件(可选)

/etc/xml : Configuration files for XML (optional)/etc/xml:XML的配置文件(可选)

/home : User home directories(optional)/home:用户的主目录(可选)

Purpose目的

Requirements要求

/lib : Essential sharedlibraries and kernel modules/lib:必需的共享库和内核模块

Purpose目的

Requirements要求

Specific Options特定选项

/lib<qual> :Alternate format essential shared libraries (optional)/lib:交换格式的必要的共享库(可选)

Purpose目的

Requirements要求

/media : Mount point for removeable media/media:可移动媒体的挂载点

Purpose目的

Specific Options特定选项

/mnt : Mount point for atemporarily mounted filesystem/mnt:临时挂载文件系统的挂载点

Purpose目的

/opt : Add-onapplication software packages/opt:扩展的应用程序软件包

Purpose目的

Requirements要求

/root : Home directory forthe root user (optional)/root:root用户的根目录(可选)

Purpose目的

/sbin : System binaries/sbin:系统工具

Purpose目的

Requirements要求

Specific Options特定选项

/srv : Data for servicesprovided by this system/srv:系统提供的服务的数据

Purpose目的

/tmp : Temporary files/tmp:临时文件

Purpose目的

4. The/usr Hierarchy/usr层次结构

Purpose目的

Requirements要求

Specific Options特定选项

/usr/X11R6 : X WindowSystem, Version 11 Release 6 (optional)/usr/X11R6:X窗口系统,版本11第6次发布(可选)

Purpose目的

Specific Options特定选项

/usr/bin : Most user commands/usr/bin:大多数用户的命令

Purpose目的

Specific Options特定选项

/usr/include :Directory for standard include files./usr/include:标准包含文件的目录

Purpose目的

Specific Options特定选项

/usr/lib : Libraries forprogramming and packages/usr/lib:编程和软件包的库。

Purpose目的

Specific Options特定选项

/usr/lib<qual> :Alternate format libraries (optional)/usr/lib:交换格式的库(可选)

Purpose目的

/usr/local : Local hierarchy/usr/local:本地层次结构

/usr/local/share/usr/local/share

/usr/sbin :Non-essential standard system binaries/非必须的标准系统工具

Purpose目的

/usr/share :Architecture-independent data/usr/share:独立于体系结构的数据

Purpose目的

Requirements要求

Specific Options特定选项

/usr/share/dict : Word lists(optional)/usr/share/dict:单词列表(可选)

/usr/share/man : Manual pages:/usr/share/man:手册页

/usr/share/misc :Miscellaneous architecture-independent data/usr/share/misc:混杂的独立于体系结构的数据

/usr/share/sgml : SGML data(optional)/usr/share/sgml:SGML数据(可选)

/usr/share/xml : XML data (optional)/usr/share/xml:XML数据(可选)

/usr/src : Source code (optional)/usr/src:源代码(可选)

Purpose目的

5. The/var Hierarchy/var层次结构

Purpose目的

Requirements要求

Specific Options特定选项

/var/account : Processaccounting logs (optional)/var/account:处理账户的日志(可选)

Purpose目的

/var/cache : Application cachedata/var/cache:应用程序的高速缓存数据

Purpose目的

Specific Options特定选项

/var/cache/fonts :Locally-generated fonts (optional)/var/cache/fonts:本地生成的字体(可选)

/var/cache/man :Locally-formatted manual pages (optional)/var/cache/man:本地格式化的手册页(可选)

/var/crash : System crash dumps(optional)/var/crash:系统崩溃转储(可选)

Purpose目的

/var/games : Variable game data(optional)/var/games:可变的游戏数据(可选)

Purpose目的

/var/lib : Variable stateinformation/var/lib:可变的状态信息

Purpose目的

Requirements要求

Specific Options特定选项

/var/lib/<editor>: Editor backup files and state (optional)/var/lib/<editor>:编辑器的备份文件和状态(可选)

/var/lib/hwclock :State directory for hwclock (optional)/var/lib/hwclock:硬件时钟的状态目录(可选)

/var/lib/misc :Miscellaneous variable data/var/lib/misc:混杂的可变数据

/var/lock : Lock files/var/lock:锁定的文件

Purpose目的

/var/log : Log files anddirectories/var/log:日志文件和目录

Purpose目的

Specific Options特定选项

/var/mail : User mailbox files(optional)/var/mail:用户的邮箱文件(可选)

Purpose目的

/var/opt : Variable data for /opt/var/opt:/opt中可变的数据

Purpose目的

/var/run : Run-time variable data/var/run:运行时的可变数据

Purpose目的

Requirements要求

/var/spool : Application spooldata/var/spool:应用程序的队列目录(如发送邮件的队列等)。

Purpose目的

Specific Options特定选项

/var/spool/lpd :Line-printer daemon print queues (optional)/var/spool/lpd:打印机守护进程的打印队列工作的目录(可选)

/var/spool/rwho : Rwhod files (optional)/var/spool/rwho:rwho的守护进程的文件(可选)

/var/tmp : Temporaryfiles preserved between system reboots/var/tmp:在系统重启期间保留的临时文件

Purpose目的

/var/yp : NetworkInformation Service (NIS) database files (optional)/var/yp:网络信息服务的数据库文件(可选)

Purpose目的

6. Operating System SpecificAnnex特定操作系统的附件

Linux

/ : Root directory/:根目录

/bin : Essential usercommand binaries (for use by all users)/bin:必要的用户命令工具(所有用户都使用)

/dev : Devices and special files/dev:设备和特定的文件

/etc : Host-specificsystem configuration/etc:特定主机的系统配置

/lib64 and /lib32 : 64/32-bit libraries (architecturedependent)/lib64和/lib32:64/32位库(依赖于体系结构)

/proc : Kernel andprocess information virtual filesystem/proc:内核和进程信息的虚拟文件系统

/sbin : Essential systembinaries/sbin:必要的系统工具

/usr/include : Headerfiles included by C programs/usr/include:C程序包含的头文件

/usr/src : Source code/usr/src:源代码

/var/spool/cron : cron and atjobs/var/spool/cron:cron和jobs

7. Appendix附录

The FHS mailing listFHS邮件列表

Background of the FHSFHS的背景

General Guidelines通用指南

Scope作用域

Acknowledgments感谢

Contributors参与者


Chapter 1. Introduction介绍

Purpose

This standard enables:

·        Software to predict thelocation of installed files and directories, and

·        使软件能够预测被安装的文件和目录的位置,和

·        Users to predict the locationof installed files and directories.

·        使用户能够预测被安装的文件和目录的位置。

We do this by:

·        Specifying guiding principlesfor each area of the filesystem,

·        声明在文件系统中每个区域的指导原则

·        Specifying the minimum filesand directories required,

·        声明需要的最小的文件和目录集合

·        Enumerating exceptions to theprinciples, and

·        列举规则的例外情况,和

·        Enumerating specific caseswhere there has been historical conflict.

·        列举在历史上有冲突的特定情况。

The FHS document is used by:

·        Independent software suppliersto create applications which are FHS compliant, and work with distributionswhich are FHS complaint,

·        独立的软件供应商,其创建的应用程序是FHS兼容的,并和FHS兼容的分发软件一起工作。

·        OS creators to provide systemswhich are FHS compliant, and

·        操作系统创造者,其提供的系统是FHS兼容的。

·        Users to understand andmaintain the FHS compliance of a system.

·        用户,理解并能够维持一个系统中的FHS。

The FHS document has a limited scope:

FHS文档有一个有限的范围:

·        Local placement of local files isa local issue, so FHS does not attempt to usurp system administrators.

·        本地文件在本地如何放置是一个本地的问题,因此FHS并没有试图夺取系统管理权限。

·        FHS addresses issues where fileplacements need to be coordinated between multiple parties such as local sites,distributions, applications, documentation, etc.

·        FHS解决文件放置的协调问题,其包含多个部分,如本地站点、发布、应用程序、文档等等。


Conventions约定

We recommend that you read a typeset version of thisdocument rather than the plain text version. In the typeset version, the namesof files and directories are displayed in a constant-width font.

我们建议你阅读本文档的一个排版后的版本,而不是纯文本。在排版的版本中,文件名和目录名使用等宽字体显示。

Components of filenames that vary are represented by adescription of the contents enclosed in "<"and ">" characters, <thus>. Electronic mail addresses are alsoenclosed in "<" and ">" but are shown in the usualtypeface.

文件名中变化的部分使用"<"和">"字符括起来,例如<thus>。电子邮件地址也使用"<"和">"括起来,但使用了普通字体。

Optional components of filenames are enclosed in "[" and "]"characters and may be combined with the "<"and ">" convention. Forexample, if a filename is allowed to occur either with or without an extension,it might be represented by <filename>[.<extension>].

文件名中可选的部分使用"["和"]"括起来,并且可能和"<"&">"约定组合起来使用。举个例子,如果一个文件名允许出现或者不出现一个扩展名,那么它可以表示为<filename>[.<extension>]

Variable substrings of directory names and filenames areindicated by "*".

目录名和文件名中的可变的子字符串使用"*"表示。

The sections of the text marked as Rationaleare explanatory and are non-normative.

标记为Rationale的文字部分是解释性的,非规范性的。


Chapter 2. The Filesystem文件系统

This standard assumes that the operating system underlyingan FHS-compliant file system supports the same basic security features found inmost UNIX filesystems.

这个标准假设运行在FHS兼容的文件系统上的操作系统支持基本的安全特性,这些安全特性在大多数UNIX文件系统中都存在。

It is possible to define two independent distinctions amongfiles: shareable vs. unshareable and variable vs. static. In general, filesthat differ in either of these respects should be located in differentdirectories. This makes it easy to store files with different usagecharacteristics on different filesystems.

在多个文件之间,我们可以定义两个相对独立的区别:可共享的与不可共享的,和可变的与不可变的。通常情况下,在以上两个方面中任一个方面有区别的文件都应该被放置在不同的目录中。这使得在不同文件系统上存储具有不同使用特性的文件变得简单。

"Shareable" files are those that can be stored onone host and used on others. "Unshareable" files are those that arenot shareable. For example, the files in user home directories are shareablewhereas device lock files are not.

“可共享”的文件可以被存储在一个主机上并被其他主机使用。“不可共享”的文件不可以被共享。举个例子,用户的主目录是“可共享”的而设备锁文件不是。

"Static" files include binaries, libraries,documentation files and other files that do not change without systemadministrator intervention. "Variable" files are files that are notstatic.

“不变”的文件包括二进制文件、库、文档和其他在系统管理员没有介入的情况下不会改变的文件。“可变”的文件是指不是“不变”的文件。

Rationale

 

Shareable files can be stored on one host and used on several others. Typically, however, not all files in the filesystem hierarchy are shareable and so each system has local storage containing at least its unshareable files. It is convenient if all the files a system requires that are stored on a foreign host can be made available by mounting one or a few directories from the foreign host.

可共享的文件可以被存储在一个主机上并且被一些其它主机使用。然而,典型地,文件系统层次结构中不是所有文件都是可共享的,因而每个系统有自己本地的存储结构,其中包含了至少它自己的不可共享的文件。如果一个系统所需的所有存储在其他主机上的文件能够通过从其他主机上挂载一个或者一些目录而变得可用,这将很方便。

Static and variable files should be segregated because static files, unlike variable files, can be stored on read-only media and do not need to be backed up on the same schedule as variable files.

静态和可变的文件需要分隔开,因为静态文件和可变文件不同,静态文件可以存储在只读的媒体中,并且不像可变文件那样需要定期备份。

Historical UNIX-like filesystem hierarchies contained both static and variable files under both /usr and /etc. In order to realize the advantages mentioned above, the /var hierarchy was created and all variable files were transferred from /usr to /var. Consequently /usr can now be mounted read-only (if it is a separate filesystem). Variable files have been transferred from /etc to /var over a longer period as technology has permitted.

历史上,类UNIX文件系统层次结构中,在/usr和/etc目录下既包含了静态的文件也包含了可变的文件。为了实现前面提到的有点,/var层次结构被创建并且将全部的/usr下的可变文件转移到了/var。因此,/usr现在可以被被只读式的挂载(如果是一个独立的文件系统)。/etc下的可变文件在经历一个相当长的时期后,随着技术的允许,也被移动到了/var下。

Here is an example of a FHS-compliant system. (Other FHS-compliant layouts are possible.)

这是一个FHS兼容的文件系统的例子。(其他FHS兼容的布局也是可能的。)

 

shareable

unshareable

static

/usr

/etc

 

/opt

/boot

variable

/var/mail

/var/run

 

/var/spool/news

/var/lock


Chapter 3. The RootFilesystem根文件系统

Purpose目的

The contents of the root filesystem must be adequate toboot, restore, recover, and/or repair the system.

根文件系统的内容必须能够完成启动、还原、恢复以及/或修复系统的工作。

·        To boot a system, enough mustbe present on the root partition to mount other filesystems. This includesutilities, configuration, boot loader information, and other essential start-updata. /usr, /opt, and /var are designed such thatthey may be located on other partitions or filesystems.

·        为了启动系统,在根分区上必须有足够的文件以挂载其他文件系统。这包括二进制工具,配置、启动加载器信息,以及其他必要的启动数据。/usr、/opt、和/var被设计为可以被存储在其他分区或文件系统下。

·        To enable recovery and/orrepair of a system, those utilities needed by an experienced maintainer todiagnose and reconstruct a damaged system must be present on the rootfilesystem.

·        为了能够还原以及/或者修复系统,需要一个经验丰富的维护人员使用根文件系统中的那些必须存在的工具来诊断并重建一个被摧毁的系统。

·        To restore a system, thoseutilities needed to restore from system backups (on floppy, tape, etc.) must bepresent on the root filesystem.

·        为了恢复一个系统,需要使用根文件系统中的那些必须存在的工具来从系统备份中恢复系统。

Rationale原理

 

The primary concern used to balance these considerations, which favor placing many things on the root filesystem, is the goal of keeping root as small as reasonably possible. For several reasons, it is desirable to keep the root filesystem small:

主要关心的事平衡了这些考虑,保持根文件系统尽可能小的主要目的是希望将很多的东西放在根文件系统中。基于一些原因,保持根文件系统的小尺寸是合乎需要的。

·         It is occasionally mounted from very small media.

·         偶尔会从非常小的媒体上挂载。

·         The root filesystem contains many system-specific configuration files. Possible examples include a kernel that is specific to the system, a specific hostname, etc. This means that the root filesystem isn‘t always shareable between networked systems. Keeping it small on servers in networked systems minimizes the amount of lost space for areas of unshareable files. It also allows workstations with smaller local hard drives.

·         根文件系统包含了许多的特定系统的配置文件。举些可能的例子:一个特定于系统的内核,一个特定的主机名等等。这意味着根文件系统不总是在网络化的系统之间可共享。在网络化系统的服务器上保持它的小尺寸使不可共享文件的空间损失减小到了最小。这也允许工作站可以使用更小的本地硬盘驱动器进行工作。

·         While you may have the root filesystem on a large partition, and may be able to fill it to your heart‘s content, there will be people with smaller partitions. If you have more files installed, you may find incompatibilities with other systems using root filesystems on smaller partitions. If you are a developer then you may be turning your assumption into a problem for a large number of users.

·         尽管你可以使用一个大的分区挂载你的根文件系统,并且能够随意填充内容,有些人使用了更小的分区。如果你安装了更多的文件,你会发现在其他更小根文件系统分区的系统上无法兼容。如果你是一个开发者,那么你需要考虑将会有大量用户的假设,并以此作为一个问题。

·         Disk errors that corrupt data on the root filesystem are a greater problem than errors on any other partition. A small root filesystem is less prone to corruption as the result of a system crash.

·         在根文件系统分区上引起数据损坏的磁盘错误是一个比其他分区上的错误更为严重的问题。一个小的根文件系统有更小的倾向导致系统崩溃。

Applications must never create or require special files orsubdirectories in the root directory. Other locations in the FHS hierarchyprovide more than enough flexibility for any package.

应用程序从来都禁止在根目录下创建或者需要创建特殊的文件或者子目录。FHS层次中的其他位置为所有的程序包提供了更多的灵活性。

Rationale原理

 

There are several reasons why creating a new subdirectory of the root filesystem is prohibited:

禁止在根文件系统中创建子目录的原因有以下几个:

·         It demands space on a root partition which the system administrator may want kept small and simple for either performance or security reasons.

·         无论是从性能还是安全方面考虑,系统管理员都要求根分区的空间保持小而且简单。

·         It evades whatever discipline the system administrator may have set up for distributing standard file hierarchies across mountable volumes.

·         这规避了任何系统管理员设立的规则,这些规则用于跨越可挂载卷建立标准文件层次。

Distributions should not create new directories in the root hierarchy without extremely careful consideration of the consequences including for application portability.

发行版不应该在根层次下面创建子目录,除非极其认真的考虑过包括应用程序可移植性在内的后果。


Requirements要求

The following directories, or symbolic links to directories,are required in /.

下列目录,或者是指向目录的符号链接,是/目录下需要的。

Directory

Description

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可变数据

Each directory listed above is specified in detail inseparate subsections below. /usr and /var each have acomplete section in this document due to the complexity of those directories.

上面列出的每个目录都在下面用单独的小节详细介绍了。由于/usr和/var目录的复杂性,每个目录都在本文中花了一个完整的章节讲解。


Specific Options特定选项

The following directories, or symbolic links todirectories, must be in /, if the corresponding subsystem isinstalled:

下面的目录或者指向目录的符号链接必须在/目录下存在,如果相应的子系统被安装了:

Directory

Description

home

User home directories (optional)用户的主目录(可选)

lib<qual>

Alternate format essential shared libraries (optional)可选格式的必要的共享库(可选)

root

Home directory for the root user (optional)root用户的主目录(可选)

Each directory listed above is specified in detail inseparate subsections below.

上面列出的每个目录都在下面用单独的小节详细介绍了。


/bin : Essentialuser command binaries (for use by all users) /bin:必要的用户命令工具(所有用户通用)

Purpose目的

/bin contains commandsthat may be used by both the system administrator and by users, but which arerequired when no other filesystems are mounted (e.g. in single user mode). Itmay also contain commands which are used indirectly by scripts. [1]

/bin包含了系统管理员和其他用户都使用的命令,并且要求在没有挂载其他文件系统的情况下也能使用。也包含了能够通过脚本间接使用的命令。[1]


Requirements要求

There must be no subdirectories in /bin./bin目录下禁止有子目录

The following commands, or symbolic links to commands, arerequired in /bin.

下列命令或者到命令的符号链接,需要放在/bin中。

Command

Description

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 editor `sed`流编辑器

sh

The Bourne command shell Bourne命令行Shell

stty

Utility to change and print terminal line settings改变和打印终端设置的工具

su

Utility to change user ID改变用户ID的工具

sync

Utility to flush filesystem buffers刷新文件系统缓冲区

true

Utility to do nothing, successfully什么也不做,返回真的工具

umount

Utility to unmount file systems卸载文件系统的工具

uname

Utility to print system information打印系统信息的工具

If /bin/sh is not a true Bourne shell, it must be ahard or symbolic link to the real shell command.

如果/bin/sh不是真的Bourne Shell,那么他必须是一个指向真正Shell命令的硬链接或符号链接。

The [ and test commands must be placedtogether in either /bin or /usr/bin.

[和test命令必须放在一起,在/bin目录或/usr/bin目录下。

Rationale原理

 

For example bash behaves differently when called as sh or bash. The use of a symbolic link also allows users to easily see that /bin/sh is not a true Bourne shell.

例如,bash被作为sh调用和bash调用时会表现的不一样。使用符号链接也允许用户方便的查看到/bin/sh不是一个正正的Bourne Shell。

The requirement for the [ and test commands to be included as binaries (even if implemented internally by the shell) is shared with the POSIX.2 standard.

对[和test命令的要求是与POSIX.2标准兼容的,尽管可能这是在shell内部实现。


Specific Options特定选项

The following programs, or symbolic links to programs, mustbe in /bin if the corresponding subsystem is installed:

如果相应的子系统被安装,那么下列程序或者指向程序的符号链接必须存在:

Command

Description

csh

The C shell (optional)C shell(可选)

ed

The `ed‘ editor (optional)`ed`编辑器(可选)

tar

The tar archiving utility (optional)归档工具(可选)

cpio

The cpio archiving utility (optional)备份归档工具(可选)

gzip

The GNU compression utility (optional)GNU压缩工具(可选)

gunzip

The GNU uncompression utility (optional)GNU解压缩工具(可选)

zcat

The GNU uncompression utility (optional)GNU解压缩工具(可选)

netstat

The network statistics utility (optional)网络统计工具(可选)

ping

The ICMP network test utility (optional)ICMP网络测试工具(可选)

If the gunzip and zcat programs exist, theymust be symbolic or hard links to gzip. /bin/csh may be a symbolic linkto /bin/tcsh or /usr/bin/tcsh.

如果gunzip和zcat程序存在,那么它们必须是指向gzip的符号链接或硬链接。/bin/csh可能是一个指向/bin/tcsh或者/usr/bin/tcsh的符号链接。

Rationale

 

The tar, gzip and cpio commands have been added to make restoration of a system possible (provided that / is intact).

已经添加tar、gzip和cpio命令来使能够恢复一个系统(前提是/是完整的)。

Conversely, if no restoration from the root partition is ever expected, then these binaries might be omitted (e.g., a ROM chip root, mounting /usr through NFS). If restoration of a system is planned through the network, then ftp or tftp (along with everything necessary to get an ftp connection) must be available on the root partition.

相反,如果不希望从根分区恢复系统,那么这些工具可以被忽略(例如,一个只读芯片的根,并通过NFS挂载/usr)。如果打算通过网络恢复系统,那么在根分区中ftp或者tftp工具(包含获取一个ftp连接所必须的东西)必须可用。


/boot : Static filesof the boot loader /boot:启动加载器的静态文件

Purpose目的

This directory contains everything required for the bootprocess except configuration files not needed at boot time and the mapinstaller. Thus /boot stores data that is used before the kernel begins executinguser-mode programs. This may include saved master boot sectors and sector mapfiles. [2]

这个目录包含了启动程序所需的所有东西,除了不是在启动阶段需要的配置文件和映射安装器之外。因此,/boot存储了在内核开始执行用户态程序之前所使用的数据。这包括保存的主引导区和区映射文件。[2]


Specific Options特定选项

The operating system kernel must be located in either /or /boot. [3]

操作系统内核必须放置在/或/boot下。[3]


/dev : Device files设备文件

Purpose目的

The /dev directory is the location of special ordevice files.

/dev目录是特殊文件或设备文件的位置。


Specific Options特定选项

If it is possible that devices in /dev will needto be manually created, /dev must contain a command named MAKEDEV,which can create devices as needed. It may also contain a MAKEDEV.localfor any local devices.

如果在/dev下可能存在这样的设备,它们需要被手动创建,那么/dev必须包含一个名为MAKEDEV的命令,此命令可以根据需要创建相应的设备。也应该包含一个对应于本地设备的MAKEDEV.local。

If required, MAKEDEV must have provisions forcreating any device that may be found on the system, not just those that aparticular implementation installs.

如果需要,MAKEDEV必须有创建任意可在系统中查找到的设备的规定,而不仅仅是一个特殊实现的安装程序。


/etc :Host-specific system configuration

/etc:特定主机的系统配置

Purpose目的

The /etc hierarchy contains configuration files. A"configuration file" is a local file used to control the operation ofa program; it must be static and cannot be an executable binary. [4]

/etc层次结构包含了配置文件。一个“配置文件”是一个用来控制程序的操作的本地文件。 它必须是一个静态的文件,并且不能是可执行的二进制文件。


Requirements要求

No binaries may be located under /etc. [5]

/etc目录下不能有可执行文件。[5]

The following directories, or symbolic links to directoriesare required in /etc:

要求在/etc目录下有下列目录或者指向目录的符号链接:

Directory

Description

opt

Configuration for /opt /opt的配置

X11

Configuration for the X Window system (optional) X窗口系统的配置(可选)

sgml

Configuration for SGML (optional) SGML的配置(可选)

xml

Configuration for XML (optional) XML的配置(可选)


Specific Options特定选项

The following directories, or symbolic links to directoriesmust be in /etc, if the corresponding subsystem is installed:

如果相应的子系统被安装,那么下列在/etc目录下的目录或者指向目录的符号链接必须存在。

Directory

Description

opt

Configuration for /opt /opt的配置

The following files, or symbolic links to files, must be in/etc if the corresponding subsystem is installed: [6]

如果相应的子系统被安装,那么下列在/etc目录下的文件或者指向文件的符号链接必须存在。

File

Description

csh.login

Systemwide initialization file for C shell logins (optional)系统级的C shell登录初始化文件(可选)

exports

NFS filesystem access control list (optional) NFS文件系统的访问控制列表(可选)

fstab

Static information about filesystems (optional)文件系统的静态信息(可选)

ftpusers

FTP daemon user access control list (optional)FTP守护进程的用户访问列表(可选)

gateways

File which lists gateways for routed (optional)列出路由网关列表的文件(可选)

gettydefs

Speed and terminal settings used by getty (optional) getty使用的速度和终端设置(可选)

group

User group file (optional)用户组文件(可选)

host.conf

Resolver configuration file (optional)解析配置文件(可选)

hosts

Static information about host names (optional)主机名字相关的静态信息(可选)

hosts.allow

Host access file for TCP wrappers (optional)TCP wrappers的主机访问文件(可选)

hosts.deny

Host access file for TCP wrappers (optional) TCP wrappers的主机访问文件(可选)

hosts.equiv

List of trusted hosts for rlogin, rsh, rcp (optional) rlogin、rsh和rcp的信任主机列表(可选)

hosts.lpd

List of trusted hosts for lpd (optional) lpd的信任主机列表(可选)

inetd.conf

Configuration file for inetd (optional) inetd的配置文件(可选)

inittab

Configuration file for init (optional)初始化配置文件(可选)

issue

Pre-login message and identification file (optional)登录前的消息和验证文件(可选)

ld.so.conf

List of extra directories to search for shared libraries (optional)查找共享库所使用的额外的目录列表(可选)

motd

Post-login message of the day file (optional)当天登陆后的消息文件(可选)

mtab

Dynamic information about filesystems (optional)文件系统的动态信息(可选)

mtools.conf

Configuration file for mtools (optional)mtools的配置文件(可选)

networks

Static information about network names (optional)网络名字的静态信息(可选)

passwd

The password file (optional)密码文件(可选)

printcap

The lpd printer capability database (optional)lpd打印机容量数据库(可选)

profile

Systemwide initialization file for sh shell logins (optional)系统级的sh shell登录初始化文件(可选)

protocols

IP protocol listing (optional)IP协议列表(可选)

resolv.conf

Resolver configuration file (optional)解析配置文件(可选)

rpc

RPC protocol listing (optional)RPC协议列表(可选)

securetty

TTY access control for root login (optional) root用户登录的TTY访问控制(可选)

services

Port names for network services (optional)网络服务的端口名字(可选)

shells

Pathnames of valid login shells (optional)有效的已登录shell的路径(可选)

syslog.conf

Configuration file for syslogd (optional)syslogd的配置文件(可选)

mtab does not fit thestatic nature of /etc: it is excepted for historical reasons. [7]

mtab并不适用于/etc的静态特性:保留它是出于历史原因。[7]


/etc/opt :Configuration files for /opt /opt的配置文件

Purpose目的

Host-specific configuration files for add-on applicationsoftware packages must be installed within the directory /etc/opt/<subdir>,where <subdir> is the name of the subtree in /opt wherethe static data from that package is stored.

用于扩展应用软件包的特定主机的配置文件必须被安装在/etc/opt/<subdir>这样的目录中,其中<subdir>是/opt中相应的软件包的静态数据存储的路径的子目录树。


Requirements要求

No structure is imposed on the internal arrangement of /etc/opt/<subdir>.

/etc/opt/<subdir>的内部组织没有结构上的要求。

If a configuration file must reside in a different locationin order for the package or system to function properly, it may be placed in alocation other than /etc/opt/<subdir>.

如果一个配置文件必须存在在一个不同的位置以保证该软件包或者系统正常工作,那么它应该放置在某个/etc/opt/<subdir>之外的其他地方。

Rationale原理

 

Refer to the rationale for /opt.参考/opt的原理。


/etc/X11 : Configurationfor the X Window System (optional)X窗口系统的配置(可选)

Purpose目的

/etc/X11 is the location for all X11 host-specific configuration. Thisdirectory is necessary to allow local control if /usris mounted read only.

/etc/X11是所有的X11特定主机的配置存放的位置。如果/usr以只读方式挂载,那么这个目录是用来允许本地控制所必须的。


Specific Options特定选项

The following files, or symbolic links to files, must be in/etc/X11 if the corresponding subsystem is installed:

下列在/etc/X11中的文件或者指向文件的符号链接必须存在,如果相应的子系统被安装:

File

Description

Xconfig

The configuration file for early versions of XFree86 (optional) XFree86早期版本的配置文件(可选)

XF86Config

The configuration file for XFree86 versions 3 and 4 (optional) XFree86版本3和4的配置文件(可选)

Xmodmap

Global X11 keyboard modification file (optional) 全局的X11键盘修改文件(可选)

Subdirectories of /etc/X11 may include those for xdmand for any other programs (some window managers, for example) that need them. [8] We recommend that window managers with onlyone configuration file which is a default .*wmrc file must name it system.*wmrc(unless there is a widely-accepted alternative name) and not use asubdirectory. Any window manager subdirectories must be identically named tothe actual window manager binary.

/etc/X11的子目录或许会包含xdm以及其它程序(例如某些窗口管理器)所需的文件。[8]我们建议窗口管理器只有一个默认的配置文件。*wmrc文件必须命名为system.*wmrc(除非有一个更为广泛接受的可选名)并且不使用子目录。任意窗口管理器的子目录必须与真实的窗口管理器二进制文件相同的命名。


/etc/sgml :Configuration files for SGML (optional) SGML的配置文件

Purpose目的

Generic configuration files defining high-level parametersof the SGML systems are installed here. Files with names *.confindicate generic configuration files. File with names *.cat are theDTD-specific centralized catalogs, containing references to all other catalogsneeded to use the given DTD. The super catalog file catalog referencesall the centralized catalogs.

定义了高级SGML系统参数的通用配置文件安装在此处。具有*.conf名字的文件指示了通用的配置文件。具有*.cat名字的文件是特定DTD的集中式目录,包含了使用指定DTD所需要的全部其他目录。这个超级目录文件记录了全部集中式目录的引用。


/etc/xml : Configuration files for XML(optional) XML配置文件(可选)

Purpose目的

Generic configuration files defining high-level parametersof the XML systems are installed here. Files with names *.confindicate generic configuration files. The super catalog file catalogreferences all the centralized catalogs.

定义了高级XML系统参数的通用配置文件安装在此处。具有*.conf名字的文件指示了通用的配置文件。这个超级目录文件记录了全部集中式目录的引用。


/home : User homedirectories (optional)用户主目录(可选)

Purpose目的

/home is a fairly standardconcept, but it is clearly a site-specific filesystem. [9] The setup will differ from host to host.Therefore, no program should rely on this location. [10]

/home是一个公平的标准观点,但是很显然是一个特定站点的文件系统。[9]不同主机之间的安装情况会不一样。因而,不应该有程序依赖于这个位置。[10]


Requirements要求

User specific configuration files for applications arestored in the user‘s home directory in a file that starts with the ‘.‘character (a "dot file"). If an application needs to create more thanone dot file then they should be placed in a subdirectory with a name startingwith a ‘.‘ character, (a "dot directory"). In this case theconfiguration files should not start with the ‘.‘ character. [11]

特定用户的应用程序配置文件保存在用户的主目录下一个以‘.’字符开始命名的文件(一个“点文件”)中。如果一个应用程序需要创建多于一个的点文件,那么它们应该被放置在一个以‘.’字符开始命名的目录(一个“点目录”)中。这种情况下,配置文件不应该以‘.’字符开始命名。[11]


/lib :Essential shared libraries and kernel modules必要的共享库和内核模块

Purpose目的

The /lib directory contains those shared libraryimages needed to boot the system and run the commands in the root filesystem,ie. by binaries in /bin and /sbin. [12]

/lib目录包含了那些共享库的镜像,在启动系统和运行在根文件系统中的命令(即/bin目录和/sbin目录下的二进制程序)时需要这些镜像。


Requirements要求

At least one of each of the following filename patterns arerequired (they may be files, or symbolic links):

至少下列每个文件名模式中至少有一个是必须的(它们或许是文件,或者符号链接)

File

Description

libc.so.*

The dynamically-linked C library (optional) 动态链接的C库(可选) 

ld*

The execution time linker/loader (optional) 链接器/加载器的执行时间(可选)

If a C preprocessor is installed, /lib/cppmust be a reference to it, for historical reasons. [13]

如果安装了一个C预处理器,那么出于历史原因,/lib/cpp必须是一个它的引用。[13]


Specific Options特定选项

The following directories, or symbolic links todirectories, must be in /lib, if the corresponding subsystem isinstalled:

如果相应的子系统被安装了,那么下列目录或者指向目录的符号链接必须在/lib下存在。

Directory

Description

modules

Loadable kernel modules (optional)可加载的内核模块(可选)


/lib<qual>: Alternate format essential shared libraries (optional)交换格式的必须的共享库(可选)

Purpose目的

There may be one or more variants of the /libdirectory on systems which support more than one binary format requiringseparate libraries. [14]

系统中可能有一个或者多个/lib的变体,以支持不同的二进制格式所需的独立的库。[14]


Requirements要求

If one or more of these directories exist, the requirementsfor their contents are the same as the normal /lib directory, exceptthat /lib<qual>/cpp is not required. [15]

如果有一个或者多个这样的目录存在,那么它们的要求和普通/lib目录的要求一样,除了/lib<qual>/cpp不是必须的。[15]


/media : Mount point forremoveable media可移动媒体的挂载点

Purpose目的

This directory contains subdirectories which are used asmount points for removeable media such as floppy disks, cdroms and zip disks.

这个目录包含了这些子目录,它们用来作为软盘、光盘以及压缩磁盘等可移动媒体的挂载点。

Rationale原理

 

Historically there have been a number of other different places used to mount removeable media such as /cdrom, /mnt or /mnt/cdrom. Placing the mount points for all removeable media directly in the root directory would potentially result in a large number of extra directories in /. Although the use of subdirectories in /mnt as a mount point has recently been common, it conflicts with a much older tradition of using /mnt directly as a temporary mount point.

历史上,有很多的其他不同的地方用来挂载可移动的媒体,例如/cdrom,/mnt,或者/mnt/cdrom。将这些所有可移动媒体的挂载点直接放在根目录下潜在地导致根目录下有大量多余的目录。尽管在/mnt下使用子目录作为挂载点最近变得常用,但是这与一个更老的直接使用/mnt作为临时挂载点的传统相冲突。


Specific Options特定选项

The following directories, or symbolic links todirectories, must be in /media, if the corresponding subsystem isinstalled:

下列目录或者指向目录的符号链接必须在/media下存在,如果相应的子系统被安装:

Directory

Description

floppy

Floppy drive (optional)软盘驱动器(可选)

cdrom

CD-ROM drive (optional)CD-ROM驱动器(可选)

cdrecorder

CD writer (optional)CD刻录机(可选)

zip

Zip drive (optional)ZIP驱动器(可选)

On systems where more than one device exists for mounting acertain type of media, mount directories can be created by appending a digit tothe name of those available above starting with ‘0‘, but the unqualified namemust also exist. [16]

当挂载的某个特定类型的媒体包含多于一个上述设备时,在这样的系统中,可以以上述可用名字后面添加以‘0’开始的数字作为名字创建相应的挂载目录,但是没有添加数字的目录必须也存在。[16]


/mnt : Mountpoint for a temporarily mounted filesystem临时文件系统的挂载点

Purpose目的

This directory is provided so that the system administratormay temporarily mount a filesystem as needed. The content of this directory isa local issue and should not affect the manner in which any program is run.

提供这个目录是为了系统管理员能够根据需要临时挂载一个文件系统。这个目录的内容是一个本地的问题并且不应该影响到任何程序运行的方式。

This directory must not be used by installation programs: asuitable temporary directory not in use by the system must be used instead.

这个目录在安装程序中禁止被使用:必须使用系统中一个合适的未被使用的临时目录来替代。


/opt : Add-onapplication software packages扩展的应用程序软件包

Purpose目的

/opt is reserved for theinstallation of add-on application software packages.

/opt是保留给扩展应用软件包安装使用的。

A package to be installed in /opt must locate itsstatic files in a separate /opt/<package> or /opt/<provider>directory tree, where <package> is a name that describes thesoftware package and <provider> is the provider‘s LANANAregistered name.

一个要安装到/opt的包必须把它的静态文件放置在独立的/opt/<package>或者/opt/<provider>目录树下,<package>是描述软件包的名字,<provider>是提供者的在Linux指派名称和数字授权(LANANA)注册的名字。


Requirements

Directory

Description

<package>

Static package objects静态包对象

<provider>

LANANA registered provider name 在LANANA注册的提供者名字

The directories /opt/bin, /opt/doc, /opt/include,/opt/info, /opt/lib, and /opt/man are reserved forlocal system administrator use. Packages may provide "front-end" filesintended to be placed in (by linking or copying) these reserved directories bythe local system administrator, but must function normally in the absence ofthese reserved directories.

/opt/bin, /opt/doc,/opt/include, /opt/info, /opt/lib, 以及 /opt/man这些目录保留给本地系统管理员使用。系统管理员可以将软件包提供的一些“前端”文件放置在这些保留的目录(通过链接或者拷贝),但是必要的功能通常可以不需要这些保留的目录。

Programs to be invoked by users must be located in thedirectory /opt/<package>/bin or under the /opt/<provider>hierarchy. If the package includes UNIX manual pages, they must be located in /opt/<package>/share/manor under the /opt/<provider> hierarchy, and the samesubstructure as /usr/share/man must be used.

用户调用的程序必须被防止在/opt/<package>/bin目录下或者在/opt/<provider>层次下。如果这个程序包包含UNIX的手册页面,这些页面必须被放置在/opt/<package>/share/man下或者/opt/<provider>层次下,并且必须使用和/usr/share/man相同的子结构。

Package files that are variable (change in normaloperation) must be installed in /var/opt. See the section on /var/optfor more information.

可变的(正常操作下变化)程序包文件必须安装在/var/opt。更多信息请查看/var/opt一节。

Host-specific configuration files must be installed in /etc/opt.See the section on /etc for more information.

特定主机的配置文件必须安装在/etc/opt。更多信息请查看/etc一节。

No other package files may exist outside the /opt,/var/opt, and /etc/opt hierarchies except for those packagefiles that must reside in specific locations within the filesystem tree inorder to function properly. For example, device lock files must be placed in /var/lockand devices must be located in /dev.

除了一些必须在文件系统树中指定位置以支持程序正常运行的文件以外,程序包的其他文件不应该在/opt、/var/opt和/etc/opt层次以外存在。举例来说,设备锁定文件必须放置在/var/lock,设备文件必须放置在/dev。

Distributions may install software in /opt, butmust not modify or delete software installed by the local system administratorwithout the assent of the local system administrator.

发行版可以在/opt安装软件,但是在未得到本地系统管理员允许的情况下禁止修改或者删除本地系统管理员安装的软件。

Rationale原理

 

The use of /opt for add-on software is a well-established practice in the UNIX community. The System V Application Binary Interface [AT&T 1990], based on the System V Interface Definition (Third Edition), provides for an /opt structure very similar to the one defined here.

将/opt用在扩展软件商是UNIX社区的一个已经确立的惯例。基于System V第三版接口定义的System V应用二进制接口[AT&T 1990]提供了一个和此处定义十分相似的/opt结构。

The Intel Binary Compatibility Standard v. 2 (iBCS2) also provides a similar structure for /opt.

Intel的二进制适配标准v.2(iBCS2)也为/opt提供了一个相似的结构。

Generally, all data required to support a package on a system must be present within /opt/<package>, including files intended to be copied into /etc/opt/<package> and /var/opt/<package> as well as reserved directories in /opt.

通常情况下,所有的一个程序包需要的数据都必须在/otp/<package>下存在,包括将要拷贝到/etc/opt/<package>和/var/opt/<package>以及/opt下保留的目录等这些目录的文件。

The minor restrictions on distributions using /opt are necessary because conflicts are possible between distribution-installed and locally-installed software, especially in the case of fixed pathnames found in some binary software.

在发行版中对/opt的使用做最小的限制是必要的,因为在不同的发行版中安装的软件和本地安装的软件可能会冲突,尤其是在某些二进制软件包里包含了固定的路径名的情况下。

The structure of the directories below /opt/<provider> is left up to the packager of the software, though it is recommended that packages are installed in /opt/<provider>/<package> and follow a similar structure to the guidelines for /opt/package. A valid reason for diverging from this structure is for support packages which may have files installed in /opt/<provider>/lib or /opt/<provider>/bin.

在/opt/<provider>下的目录结构留给了软件的打包人,尽管建议把包安装在/opt/<provider>/<package>下并采用一个和/opt/<package>相同的指导方案。这样做的一个原因是位置支持某些程序包,这些程序包可能有一些文件安装在了/opt/<provider>/lib或者/opt/<provider>/bin目录下。


/root : Homedirectory for the root user (optional) root用户的主目录(可选)

Purpose目的

The root account‘s home directory may be determined bydeveloper or local preference, but this is the recommended default location. [17]

Root账户的主目录可以由开发者或者本地优选决定,但是这个是建议的默认位置。[17]


/sbin : System binaries系统文件

Purpose目的

Utilities used for system administration (and otherroot-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. [18] Programs executed after /usr isknown 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.[19]

系统管理工具(和其他的仅root命令)存储在/sbin, /usr/sbin, 和/usr/local/sbin下。/sbin包含了除了/bin以外的启动、恢复、重建以及修复系统必需的文件。[18]在/usr挂载之后(没有错误发生)才执行的程序通常被放在/usr/sbin目录下。本地安装的系统管理程序应该被放置在/usr/local/sbin。


Requirements要求

The following commands, or symbolic links to commands, arerequired in /sbin.

下列命令或者指向命令的符号链接要求在/sbin下存在。

Command命令

Description描述

shutdown

Command to bring the system down.使系统down掉的命令


Specific Options特定选项

The following files, or symbolic links to files, must be in/sbin if the corresponding subsystem is installed:

下列文件或者指向文件的符号链接必须在/sbin下存在,如果相应的子系统被安装:

Command命令

Description描述

fastboot

Reboot the system without checking the disks (optional)不检查磁盘直接重启系统(可选)

fasthalt

Stop the system without checking the disks (optional)不检查磁盘直接停止系统(可选)

fdisk

Partition table manipulator (optional)操作分区表(可选)

fsck

File system check and repair utility (optional)文件系统检查及修复工具(可选)

fsck.*

File system check and repair utility for a specific filesystem (optional)特定某个文件系统的文件系统检查及修复工具(可选)

getty

The getty program (optional) getty程序(可选)

halt

Command to stop the system (optional)停止系统的命令(可选)

ifconfig

Configure a network interface (optional)配置网络接口(可选)

init

Initial process (optional)初始化程序(可选)

mkfs

Command to build a filesystem (optional)建立文件系统的命令(可选)

mkfs.*

Command to build a specific filesystem (optional)建立一个指定的文件系统的命令(可选)

mkswap

Command to set up a swap area (optional)建立一个交换分区的命令(可选)

reboot

Command to reboot the system (optional)重启系统的命令(可选)

route

IP routing table utility (optional)IP路由表工具(可选)

swapon

Enable paging and swapping (optional)使能分页和交换(可选)

swapoff

Disable paging and swapping (optional)禁止分页和交换(可选)

update

Daemon to periodically flush filesystem buffers (optional)周期性刷新文件系统缓冲区的守护进程(可选)


/srv : Data forservices provided by this system系统提供的服务的数据

Purpose目的

/srv contains site-specificdata which is served by this system.

/srv包含了当前系统所提供的服务的特定站点的数据。

Rationale原理

 

This main purpose of specifying this is so that users may find the location of the data files for particular service, and so that services which require a single tree for readonly data, writable data and scripts (such as cgi scripts) can be reasonably placed. Data that is only of interest to a specific user should go in that users‘ home directory.

指定这个目录的主要目的是为了使用户能够找到特定服务的数据文件的位置,以及需要一个单独的树存储只读数据、可写数据以及脚本(如cgi脚本)的服务可以被合理地放置。只对某特定用户感兴趣的数据应存放在该用户的主目录下。

The methodology used to name subdirectories of /srv is unspecified as there is currently no consensus on how this should be done. One method for structuring data under /srv is by protocol, eg. ftp, rsync, www, and cvs. On large systems it can be useful to structure /srv by administrative context, such as /srv/physics/www, /srv/compsci/cvs, etc. This setup will differ from host to host. Therefore, no program should rely on a specific subdirectory structure of /srv existing or data necessarily being stored in /srv. However /srv should always exist on FHS compliant systems and should be used as the default location for such data.

/srv目录下的子目录如何命名目前尚未有统一的约定。一个组织/srv下的数据的方法是根据协议,如ftp、rsync、www以及cvs等。在大的系统中根据管理上下文组织/srv下的数据结构很有用,比如/srv/physics/www、/srv/compsci/cvs等等。这些建立方式在不同的主机上是不同的。因此,程序不应该依赖于/srv下的某个特定的子目录结构,也不能依赖于存储在/rv下的数据。然而,在FHS兼容的系统中/srv应当一直存在并作为存储此类数据的默认位置。

Distributions must take care not to remove locally placed files in these directories without administrator permission. [20]

发行版必须注意未经管理员许可不要把本地放置在这些目录的文件删掉。


/tmp : Temporary files临时文件

Purpose目的

The /tmp directory must be made available forprograms that require temporary files.

/tmp目录必须对需要临时文件的程序可用。

Programs must not assume that any files or directories in /tmpare preserved between invocations of the program.

程序不可以假定在/tmp下有任何文件或者目录在多次调用该程序时是保留的。

Rationale原理

 

IEEE standard P1003.2 (POSIX, part 2) makes requirements that are similar to the above section.

IEEE标准P1003.2(POSIX,第二部分)制定了和上节相似的要求。

Although data stored in /tmp may be deleted in a site-specific manner, it is recommended that files and directories located in /tmp be deleted whenever the system is booted.

尽管存储在/tmp的数据可以以特定站点的方式被删除,我们建议每次系统启动后删除所有存放在/tmp下的文件和目录。

FHS added this recommendation on the basis of historical precedent and common practice, but did not make it a requirement because system administration is not within the scope of this standard.

FHS将这个建议添加为基本的历史先例和惯用操作,但是没有把这作为一项要求,因为系统的管理不在本标准的范围之内。


Chapter 4. The /usr Hierarchy/usr层次结构

Purpose目的

/usr is the second majorsection of the filesystem. /usr is shareable, read-only data. Thatmeans that /usr should be shareable between various FHS-complianthosts and must not be written to. Any information that is host-specific orvaries with time is stored elsewhere.

/usr是文件系统的第二个主要的章节。/usr是可共享的、只读的数据。这意味着/usr在多个可变的FHS兼容的主机之间是可共享的,并且禁止往里写入。任何特定主机的或者随时间变化的信息都应该存放在除/usr之外的其他地方。

Large software packages must not use a direct subdirectoryunder the /usr hierarchy.

大型软件包禁止在/usr层次下直接使用一个子目录。


Requirements要求

The following directories, or symbolic links todirectories, are required in /usr.下列目录或者指向目录的符号链接需要在/usr下存在。

Directory

Description

bin

Most user commands大多数的用户命令

include

Header files included by C programs C程序包含的头文件

lib

Libraries库

local

Local hierarchy (empty after main installation) 本地层次结构(主安装结束后为空)

sbin

Non-vital system binaries 不重要的系统命令

share

Architecture-independent data独立于体系结构的数据


Specific Options特定选项

Directory

Description

X11R6

XWindow System, version 11 release 6 (optional) X窗口系统,版本11,第6次发布(可选)

games

Games and educational binaries (optional) 游戏和教育工具(可选)

lib<qual>

Alternate Format Libraries (optional)交换格式的库(可选)

src

Source code (optional)源代码(可选)

An exception is made for the X Window System because ofconsiderable precedent and widely-accepted practice.

由于相当多的先例以及被广泛的接受,因此将X窗口系统作为了一个例外。

The following symbolic links to directories may be present.This possibility is based on the need to preserve compatibility with oldersystems until all implementations can be assumed to use the /varhierarchy.

下列指向目录的符号链接可能存在。这种可能性是基于对旧的系统进行兼容的需求,直到可以假定所有的实现都是使用/var层次结构。

    /usr/spool -> /var/spool
    /usr/tmp -> /var/tmp
    /usr/spool/locks -> /var/lock

Once a system no longer requires any one of the abovesymbolic links, the link may be removed, if desired.

一旦一个系统不再需要上述任意一个符号链接,那么如果想要删除相应的连接,就可以进行删除。


/usr/X11R6 : XWindow System, Version 11 Release 6 (optional) X窗口系统,版本11第6次发布

Purpose目的

This hierarchy is reserved for the X Window System, version11 release 6, and related files.

这个层次结构是保留给X窗口系统(版本11,第6次发布)以及相关文件的。

To simplify matters and make XFree86 more compatible withthe X Window System on other systems, the following symbolic links must bepresent if /usr/X11R6 exists:

为了简化问题以及使XFree86与X窗口系统在其他系统上更好的兼容,如果/usr/X11R6存在,那么下列符号链接必须存在:

    /usr/bin/X11 -> /usr/X11R6/bin
    /usr/lib/X11 -> /usr/X11R6/lib/X11
    /usr/include/X11 -> /usr/X11R6/include/X11

In general, software must not be installed or managed viathe above symbolic links. They are intended for utilization by users only. The difficultyis related to the release version of the X Window System — in transitional periods, it is impossible to know what release ofX11 is in use.

通常软件禁止通过上述符号链接进行管理也不能安装在上述符号链接的位置。它们只是用来被用户使用。困难与X窗口系统的发布版本有关——在过渡期内,无法知道在使用X11的什么发布版本。


Specific Options特定选项

Host-specific data in /usr/X11R6/lib/X11 should beinterpreted as a demonstration file. Applications requiring information aboutthe current host must reference a configuration file in /etc/X11,which may be linked to a file in /usr/X11R6/lib. [21]

存放在/usr/X11R6/lib/X11中的特定主机的数据应该理解为演示文件。需要当前主机信息的应用程序必须参考/etc/X11中的一个配置文件,这个配置文件可能链接到一个/usr/X11R6/lib中的文件。[21]


/usr/bin : Most usercommands大多数用户命令

Purpose目的

This is the primary directory of executable commands on thesystem.

这是系统上存放可执行命令的主要的目录。


Specific Options特定选项

The following directories, or symbolic links todirectories, must be in /usr/bin, if the corresponding subsystem isinstalled:

如果相应的子系统被安装,则下列目录或者指向目录的符号链接必须在/usr/bin下存在:

Directory

Description

mh

Commands for the MH mail handling system (optional) MH邮件系统相关的命令

/usr/bin/X11 must be asymlink to /usr/X11R6/bin if the latter exists.

如果后面的存在,那么/usr/bin/X11必须是一个指向/usr/X11R6/bin的符号链接。

The following files, or symbolic links to files, must be in/usr/bin, if the corresponding subsystem is installed:

如果相应的子系统被安装,那么下列文件或者指向文件的符号链接必须在/usr/bin下存在:

Command

Description

perl

The Practical Extraction and Report Language (optional) Perl语言(可选)

python

The Python interpreted language (optional) Python语言(可选)

tclsh

Simple shell containing Tcl interpreter (optional) 包含tcl解释器的简单shell(可选)

wish

Simple Tcl/Tk windowing shell (optional)简单的tcl/tk窗口式shell(可选)

expect

Program for interactive dialog (optional)交互式对话框程序(可选)

Rationale原理

 

Because shell script interpreters (invoked with #!<path> on the first line of a shell script) cannot rely on a path, it is advantageous to standardize their locations. The Bourne shell and C-shell interpreters are already fixed in /bin, but Perl, Python, and Tcl are often found in many different places. They may be symlinks to the physical location of the shell interpreters.

因为shell脚本解释器(由一个shell脚本的第一行#!/<path>指定)不能依赖于某个路径,因此标准化它们的路径是有好处的。Bourne Shell和C Shell已经固定在了/bin,但是Perl、Python和Tcl通常可以在许多不同的地方被发现。它们可能是指向该Shell解释器物理地址的符号链接。


/usr/include :Directory for standard include files.标准包含文件的目录

Purpose目的

This is where all of the system‘s general-use include filesfor the C programming language should be placed.

这是所有系统中C程序通用包含文件应该放置的地方。


Specific Options特定选项

The following directories, or symbolic links to directories,must be in /usr/include, if the corresponding subsystem is installed:

如果相应的子系统被安装,那么下列目录或者指向目录的符号链接必须在/usr/include下存在:

Directory

Description

bsd

BSD compatibility include files (optional)与BSD兼容的包含文件

The symbolic link /usr/include/X11 must link to /usr/X11R6/include/X11if the latter exists.

符号链接/usr/include/X11必须链接到/usr/X11R6/include/X11,如果后者存在。


/usr/lib :Libraries for programming and packages编程和程序包的库

Purpose目的

/usr/lib includes objectfiles, libraries, and internal binaries that are not intended to be executeddirectly by users or shell scripts. [22]

/usr/lib包含了目标文件、库以及不会被用户或者shell脚本直接执行的内部文件。[22]

Applications may use a single subdirectory under /usr/lib.If an application uses a subdirectory, all architecture-dependent dataexclusively used by the application must be placed within that subdirectory. [23]

应用程序可以在/usr/lib下单独使用一个子目录。如果一个应用程序使用了一个子目录,那么只有该程序使用的体系结构相关的数据必须放置在该子目录下。[23]


Specific Options特定选项

For historical reasons, /usr/lib/sendmail must be asymbolic link to /usr/sbin/sendmail if the latter exists. [24]

出于历史原因,/usr/lib/sendmail必须是一个指向/usr/sbin/sendmail,如果后者存在。[24]

If /lib/X11 exists, /usr/lib/X11 must bea symbolic link to /lib/X11, or to whatever /lib/X11 is asymbolic link to. [25]

如果/lib/X11存在,那么/usr/lib/X11必须是一个符号链接,指向/lib/X11或者符号链接/lib/X11所指向的东西。[25]


/usr/lib<qual>: Alternate format libraries (optional) 交换格式的库(可选)

Purpose目的

/usr/lib<qual>performs the same role as /usr/lib for an alternate binary format,except that the symbolic links /usr/lib<qual>/sendmail and /usr/lib<qual>/X11are not required. [26]

/usr/lib<qual>作为交换二进制的一种格式,行使与/usr/lib相同的角色,但有一点除外,就是/usr/lib<qual>/sendmail/usr/lib<qual>/X11不是必须的。


/usr/local : Localhierarchy 本地层次结构

Purpose目的

The /usr/local hierarchy is for use by the systemadministrator when installing software locally. It needs to be safe from beingoverwritten when the system software is updated. It may be used for programsand data that are shareable amongst a group of hosts, but not found in /usr.

/usr/local层次结构是系统管理员在本地安装软件时使用的。在系统软件更新时要求它是安全的,不被覆盖。它可以用于在一组主机之间作为可共享的程序和数据,这些程序和数据在/usr中找不到。

Locally installed software must be placed within /usr/localrather than /usr unless it is being installed to replace or upgradesoftware in /usr. [27]

本地安装的软件应该放置在/usr/local而不是/usr,除非它的安装是用来代替或者升级原先处在/usr中的软件。


Requirements要求

The following directories, or symbolic links todirectories, must be in /usr/local

下列目录或者指向目录的符号链接必须在/usr/local下存在:

Directory

Description

bin

Local binaries本地二进制文件

etc

Host-specific system configuration for local binaries本地二进制文件的特定主机的系统配置

games

Local game binaries本地游戏二进制文件

include

Local C header files本地C头文件

lib

Local libraries本地库

man

Local online manuals本地的在线手册

sbin

Local system binaries本地的系统工具

share

Local architecture-independent hierarchy本地独立于体系结构的层次结构

src

Local source code本地源代码

No other directories, except those listed below, may be in /usr/localafter first installing a FHS-compliant system.

在第一次安装完一个FHS兼容的系统之后,除了那些下面列举出来的目录,不允许其他目录在/usr/local下存在。


Specific Options特定选项

If directories /lib<qual> or /usr/lib<qual>exist, the equivalent directories must also exist in /usr/local.

如果目录/lib<qual> 或者/usr/lib<qual>存在,那么在/usr/local中等价的目录也必须存在。

/usr/local/etc may be asymbolic link to /etc/local.

/usr/local/etc可能是一个指向/etc/local的符号链接。

Rationale原理

 

The consistency of /usr/local/etc is beneficial to installers, and is already used in other systems. As all of /usr/local needs to be backed up to reproduce a system, it introduces no additional maintenance overhead, but a symlink to /etc/local is suitable if systems want all their configuration under one hierarchy.

/usr/local/etc的一致性对安装者来说是有利的,并且这在其他系统上也采用了。由于复制一个系统时需要将/usr/local下的所有东西备份,因此这样没有引入额外的维护工作量;但是如果系统想要在某个体系结构下的所有配置,一个指向/etc/local的符号链接是合适的。

Note that /usr/etc is still not allowed: programs in /usr should place configuration files in /etc.

注意/usr/etc仍然是不允许的:/usr下的程序将配置文件存放在/etc下。


/usr/local/share

The requirements for the contents of this directory are thesame as /usr/share. The only additional constraint is that /usr/local/share/manand /usr/local/man directories must be synonomous (usually this meansthat one of them must be a symbolic link). [28]

对这个目录的内容的要求与/usr/share相同。仅有的附加约束是/usr/local/share/man/usr/local/man directories必须是***的(这意味着它们其中的一个必须是符号链接)。[28]


/usr/sbin :Non-essential standard system binaries高级的标准系统工具

Purpose目的

This directory contains any non-essential binaries usedexclusively by the system administrator. System administration programs thatare required for system repair, system recovery, mounting /usr, orother essential functions must be placed in /sbin instead. [29]

 


/usr/share :Architecture-independent data

Purpose

The /usr/share hierarchy is for all read-only architectureindependent data files. [30]

This hierarchy is intended to be shareable among allarchitecture platforms of a given OS; thus, for example, a site with i386,Alpha, and PPC platforms might maintain a single /usr/share directorythat is centrally-mounted. Note, however, that /usr/share is generallynot intended to be shared by different OSes or by different releases of thesame OS.

Any program or package which contains or requires data thatdoesn‘t need to be modified should store that data in /usr/share (or /usr/local/share,if installed locally). It is recommended that a subdirectory be used in /usr/sharefor this purpose.

Game data stored in /usr/share/games must bepurely static data. Any modifiable files, such as score files, game play logs,and so forth, should be placed in /var/games.


Requirements

The following directories, or symbolic links todirectories, must be in /usr/share

Directory

Description

man

Online manuals

misc

Miscellaneous architecture-independent data


Specific Options

The following directories, or symbolic links todirectories, must be in /usr/share, if the corresponding subsystem isinstalled:

Directory

Description

dict

Word lists (optional)

doc

Miscellaneous documentation (optional)

games

Static data files for /usr/games (optional)

info

GNU Info system s primary directory (optional)

locale

Locale information (optional)

nls

Message catalogs for Native language support (optional)

sgml

SGML data (optional)

terminfo

Directories for terminfo database (optional)

tmac

troff macros not distributed with groff (optional)

xml

XML data (optional)

zoneinfo

Timezone information and configuration (optional)

It is recommended that application-specific,architecture-independent directories be placed here. Such directories include groff,perl, ghostscript, texmf, and kbd (Linux) or syscons(BSD). They may, however, be placed in /usr/lib for backwardscompatibility, at the distributor‘s discretion. Similarly, a /usr/lib/gameshierarchy may be used in addition to the /usr/share/games hierarchy ifthe distributor wishes to place some game data there.


/usr/share/dict : Word lists(optional)

Purpose

This directory is the home for word lists on the system;Traditionally this directory contains only the English words file,which is used by look(1) and various spelling programs. words mayuse either American or British spelling.

Rationale

 

The reason that only word lists are located here is that they are the only files common to all spell checkers.


Specific Options

The following files, or symbolic links to files, must be in/usr/share/dict, if the corresponding subsystem is installed:

File

Description

words

List of English words (optional)

Sites that require both American and British spelling maylink words to -/usr/share/dict/american-english or -/usr/share/dict/british-english.

Word lists for other languages may be added using the Englishname for that language, e.g., /usr/share/dict/french, /usr/share/dict/danish,etc. These should, if possible, use an ISO 8859 character set which isappropriate for the language in question; if possible the Latin1 (ISO 8859-1)character set should be used (this is often not possible).

Other word lists must be included here, if present.


/usr/share/man : Manualpages

Purpose

This section details the organization for manual pagesthroughout the system, including /usr/share/man. Also refer to thesection on /var/cache/man.

The primary <mandir> of the system is /usr/share/man./usr/share/man contains manual information for commands and data underthe / and /usr filesystems. [31]

Manual pages are stored in <mandir>/<locale>/man<section>/<arch>.An explanation of <mandir>, <locale>, <section>,and <arch> is given below.

A description of each section follows:

·        man1: User programs Manual pages that describe publicly accessiblecommands are contained in this chapter. Most program documentation that a userwill need to use is located here.

·        man2: System calls This section describes all of the system calls(requests for the kernel to perform operations).

·        man3: Library functions and subroutines Section 3 describes programlibrary routines that are not direct calls to kernel services. This and chapter2 are only really of interest to programmers.

·        man4: Special files Section 4 describes the special files, relateddriver functions, and networking support available in the system. Typically,this includes the device files found in /dev and the kernel interfaceto networking protocol support.

·        man5: File formats The formats for many data files are documented in thesection 5. This includes various include files, program output files, andsystem files.

·        man6: Games This chapter documents games, demos, and generally trivialprograms. Different people have various notions about how essential this is.

·        man7: Miscellaneous Manual pages that are difficult to classify aredesignated as being section 7. The troff and other text processing macropackages are found here.

·        man8: System administration Programs used by system administrators forsystem operation and maintenance are documented here. Some of these programsare also occasionally useful for normal users.


Specific Options

The following directories, or symbolic links todirectories, must be in /usr/share/<mandir>/<locale>,unless they are empty: [32]

Directory

Description

man1

User programs (optional)

man2

System calls (optional)

man3

Library calls (optional)

man4

Special files (optional)

man5

File formats (optional)

man6

Games (optional)

man7

Miscellaneous (optional)

man8

System administration (optional)

The component <section> describes the manualsection.

Provisions must be made in the structure of /usr/share/manto support manual pages which are written in different (or multiple) languages.These provisions must take into account the storage and reference of thesemanual pages. Relevant factors include language (including geographical-baseddifferences), and character code set.

This naming of language subdirectories of /usr/share/manis based on Appendix E of the POSIX 1003.1 standard which describes the localeidentification string — the most well-accepted methodto describe a cultural environment. The <locale> string is:

<language>[_<territory>][.<character-set>][,<version>]

The <language> field must be taken from ISO639 (a code for the representation of names of languages). It must be twocharacters wide and specified with lowercase letters only.

The <territory> field must be the two-lettercode of ISO 3166 (a specification of representations of countries), ifpossible. (Most people are familiar with the two-letter codes used for thecountry codes in email addresses.) It must be two characters wide and specifiedwith uppercase letters only. [33]

The <character-set> field must represent thestandard describing the character set. If the -<character-set>field is just a numeric specification, the number represents the number of theinternational standard describing the character set. It is recommended thatthis be a numeric representation if possible (ISO standards, especially), notinclude additional punctuation symbols, and that any letters be in lowercase.

A parameter specifying a <version> of theprofile may be placed after the -<character-set> field,delimited by a comma. This may be used to discriminate between differentcultural needs; for instance, dictionary order versus a more systems-orientedcollating order. This standard recommends not using the <version>field, unless it is necessary.

Systems which use a unique language and code set for allmanual pages may omit the <locale> substring and store allmanual pages in <mandir>. For example, systems which only haveEnglish manual pages coded with ASCII, may store manual pages (the man<section>directories) directly in /usr/share/man. (That is the traditionalcircumstance and arrangement, in fact.)

Countries for which there is a well-accepted standardcharacter code set may omit the -<character-set> field, but it isstrongly recommended that it be included, especially for countries with severalcompeting standards.

Various examples:

Language

Territory

Character Set

Directory

English

ASCII

/usr/share/man/en

English

United Kingdom

ISO 8859-15

/usr/share/man/en_GB

English

United States

ASCII

/usr/share/man/en_US

French

Canada

ISO 8859-1

/usr/share/man/fr_CA

French

France

ISO 8859-1

/usr/share/man/fr_FR

German

Germany

ISO 646

/usr/share/man/de_DE.646

German

Germany

ISO 6937

/usr/share/man/de_DE.6937

German

Germany

ISO 8859-1

/usr/share/man/de_DE.88591

German

Switzerland

ISO 646

/usr/share/man/de_CH.646

Japanese

Japan

JIS

/usr/share/man/ja_JP.jis

Japanese

Japan

SJIS

/usr/share/man/ja_JP.sjis

Japanese

Japan

UJIS (or EUC-J)

/usr/share/man/ja_JP.ujis

Similarly, provision must be made for manual pages whichare architecture-dependent, such as documentation on device-drivers orlow-level system administration commands. These must be placed under an <arch>directory in the appropriate man<section> directory; forexample, a man page for the i386 ctrlaltdel(8) command might be placed in /usr/share/man/<locale>/man8/i386/ctrlaltdel.8.

Manual pages for commands and data under /usr/localare stored in /usr/local/man. Manual pages for X11R6 are stored in /usr/X11R6/man.It follows that all manual page hierarchies in the system must have the samestructure as /usr/share/man.

The cat page sections (cat<section>)containing formatted manual page entries are also found within subdirectoriesof <mandir>/<locale>, but are not required nor may they bedistributed in lieu of nroff source manual pages.

The numbered sections "1" through "8"are traditionally defined. In general, the file name for manual pages locatedwithin a particular section end with .<section>.

In addition, some large sets of application-specific manualpages have an additional suffix appended to the manual page filename. Forexample, the MH mail handling system manual pages must have mhappended to all MH manuals. All X Window System manual pages must have an xappended to the filename.

The practice of placing various language manual pages inappropriate subdirectories of /usr/share/man also applies to the othermanual page hierarchies, such as /usr/local/man and /usr/X11R6/man.(This portion of the standard also applies later in the section on the optional/var/cache/man structure.)


/usr/share/misc: Miscellaneous architecture-independent data

This directory contains miscellaneousarchitecture-independent files which don‘t require a separate subdirectoryunder /usr/share.


Specific Options

The following files, or symbolic links to files, must be in/usr/share/misc, if the corresponding subsystem is installed:

File

Description

ascii

ASCII character set table (optional)

magic

Default list of magic numbers for the file command (optional)

termcap

Terminal capability database (optional)

termcap.db

Terminal capability database (optional)

Other (application-specific) files may appear here, but adistributor may place them in /usr/lib at their discretion. [34]


/usr/share/sgml : SGMLdata (optional)

Purpose

/usr/share/sgml containsarchitecture-independent files used by SGML applications, such as ordinarycatalogs (not the centralized ones, see /etc/sgml), DTDs, entities, orstyle sheets.


Specific Options

The following directories, or symbolic links todirectories, must be in /usr/share/sgml, if the correspondingsubsystem is installed:

Directory

Description

docbook

docbook DTD (optional)

tei

tei DTD (optional)

html

html DTD (optional)

mathml

mathml DTD (optional)

Other files that are not specific to a given DTD may residein their own subdirectory.


/usr/share/xml : XML data (optional)

Purpose

/usr/share/xml contains architecture-independentfiles used by XML applications, such as ordinary catalogs (not the centralizedones, see /etc/sgml), DTDs, entities, or style sheets.


Specific Options

The following directories, or symbolic links todirectories, must be in /usr/share/xml, if the corresponding subsystemis installed:

Directory

Description

docbook

docbook XML DTD (optional)

xhtml

XHTML DTD (optional)

mathml

MathML DTD (optional)


/usr/src : Source code (optional)

Purpose

Source code may be place placed in this subdirectory, onlyfor reference purposes. [35]


Chapter 5. The /var Hierarchy

Purpose

/var contains variabledata files. This includes spool directories and files, administrative andlogging data, and transient and temporary files.

Some portions of /var are not shareable betweendifferent systems. For instance, /var/log, /var/lock, and /var/run.Other portions may be shared, notably /var/mail, /var/cache/man,/var/cache/fonts, and /var/spool/news.

/var is specified here inorder to make it possible to mount /usr read-only. Everything thatonce went into /usr that is written to during system operation (asopposed to installation and software maintenance) must be in /var.

If /var cannot be made a separate partition, it isoften preferable to move /var out of the root partition and into the /usrpartition. (This is sometimes done to reduce the size of the root partition orwhen space runs low in the root partition.) However, /var must not belinked to /usr because this makes separation of /usr and /varmore difficult and is likely to create a naming conflict. Instead, link /varto /usr/var.

Applications must generally not add directories to the toplevel of /var. Such directories should only be added if they have somesystem-wide implication, and in consultation with the FHS mailing list.


Requirements

The following directories, or symbolic links todirectories, are required in /var.

Directory

Description

cache

Application cache data

lib

Variable state information

local

Variable data for /usr/local

lock

Lock files

log

Log files and directories

opt

Variable data for /opt

run

Data relevant to running processes

spool

Application spool data

tmp

Temporary files preserved between system reboots

Several directories are `reserved‘ in the sense that theymust not be used arbitrarily by some new application, since they would conflictwith historical and/or local practice. They are:

    /var/backups
    /var/cron
    /var/msgs
    /var/preserve

Specific Options

The following directories, or symbolic links todirectories, must be in /var, if the corresponding subsystem isinstalled:

Directory

Description

account

Process accounting logs (optional)

crash

System crash dumps (optional)

games

Variable game data (optional)

mail

User mailbox files (optional)

yp

Network Information Service (NIS) database files (optional)


/var/account :Process accounting logs (optional)

Purpose

This directory holds the current active process accountinglog and the composite process usage data (as used in some UNIX-like systems by lastcommand sa).


/var/cache :Application cache data

Purpose

/var/cache is intended forcached data from applications. Such data is locally generated as a result oftime-consuming I/O or calculation. The application must be able to regenerateor restore the data. Unlike /var/spool, the cached files can bedeleted without data loss. The data must remain valid between invocations ofthe application and rebooting the system.

Files located under /var/cache may be expired inan application specific manner, by the system administrator, or both. Theapplication must always be able to recover from manual deletion of these files(generally because of a disk space shortage). No other requirements are made onthe data format of the cache directories.

Rationale

 

The existence of a separate directory for cached data allows system administrators to set different disk and backup policies from other directories in /var.


Specific Options

Directory

Description

fonts

Locally-generated fonts (optional)

man

Locally-formatted manual pages (optional)

www

WWW proxy or cache data (optional)

<package>

Package specific cache data (optional)


/var/cache/fonts: Locally-generated fonts (optional)

Purpose

The directory /var/cache/fonts should be used tostore any dynamically-created fonts. In particular, all of the fonts which areautomatically generated by mktexpk must be located inappropriately-named subdirectories of /var/cache/fonts. [36]


Specific Options

Other dynamically created fonts may also be placed in thistree, under appropriately-named subdirectories of /var/cache/fonts.


/var/cache/man: Locally-formatted manual pages (optional)

Purpose

This directory provides a standard location for sites thatprovide a read-only /usr partition, but wish to allow caching of locally-formattedman pages. Sites that mount /usr as writable (e.g., single-userinstallations) may choose not to use /var/cache/man and may writeformatted man pages into the cat<section> directories in /usr/share/mandirectly. We recommend that most sites use one of the following optionsinstead:

·        Preformat all manual pagesalongside the unformatted versions.

·        Allow no caching of formattedman pages, and require formatting to be done each time a man page is broughtup.

·        Allow local caching offormatted man pages in /var/cache/man.

The structure of /var/cache/man needs to reflectboth the fact of multiple man page hierarchies and the possibility of multiplelanguage support.

Given an unformatted manual page that normally appears in <path>/man/<locale>/man<section>,the directory to place formatted man pages in is /var/cache/man/<catpath>/<locale>/cat<section>,where <catpath> is derived from <path> byremoving any leading usr and/or trailing share pathnamecomponents. (Note that the <locale> component may be missing.) [37]

Man pages written to /var/cache/man may eventuallybe transferred to the appropriate preformatted directories in the source manhierarchy or expired; likewise formatted man pages in the source manhierarchy may be expired if they are not accessed for a period of time.

If preformatted manual pages come with a system onread-only media (a CD-ROM, for instance), they must be installed in the source manhierarchy (e.g. /usr/share/man/cat<section>). /var/cache/manis reserved as a writable cache for formatted manual pages.

Rationale

 

Release 1.2 of the standard specified /var/catman for this hierarchy. The path has been moved under /var/cache to better reflect the dynamic nature of the formatted man pages. The directory name has been changed to man to allow for enhancing the hierarchy to include post-processed formats other than "cat", such as PostScript, HTML, or DVI.


/var/crash : System crashdumps (optional)

Purpose

This directory holds system crash dumps. As of the date of thisrelease of the standard, system crash dumps were not supported under Linux butmay be supported by other systems which may comply with the FHS.


/var/games : Variablegame data (optional)

Purpose

Any variable data relating to games in /usr shouldbe placed here. /var/games should hold the variable data previouslyfound in /usr; static data, such as help text, level descriptions, andso on, must remain elsewhere, such as /usr/share/games.

Rationale

 

/var/games has been given a hierarchy of its own, rather than leaving it merged in with the old /var/lib as in release 1.2. The separation allows local control of backup strategies, permissions, and disk usage, as well as allowing inter-host sharing and reducing clutter in /var/lib. Additionally, /var/games is the path traditionally used by BSD.


/var/lib : Variablestate information

Purpose

This hierarchy holds state information pertaining to anapplication or the system. State information is data that programs modify whilethey run, and that pertains to one specific host. Users must never need tomodify files in /var/lib to configure a package‘s operation.

State information is generally used to preserve thecondition of an application (or a group of inter-related applications) betweeninvocations and between different instances of the same application. Stateinformation should generally remain valid after a reboot, should not be loggingoutput, and should not be spooled data.

An application (or a group of inter-related applications)must use a subdirectory of /var/lib for its data. There is onerequired subdirectory, /var/lib/misc, which is intended for statefiles that don‘t need a subdirectory; the other subdirectories should only bepresent if the application in question is included in the distribution. [38]

/var/lib/<name> isthe location that must be used for all distribution packaging support.Different distributions may use different names, of course.


Requirements

The following directories, or symbolic links todirectories, are required in /var/lib:

Directory

Description

misc

Miscellaneous state data


Specific Options

The following directories, or symbolic links todirectories, must be in /var/lib, if the corresponding subsystem isinstalled:

Directory

Description

<editor>

Editor backup files and state (optional)

<pkgtool>

Packaging support files (optional)

<package>

State data for packages and subsystems (optional)

hwclock

State directory for hwclock (optional)

xdm

X display manager variable data (optional)


/var/lib/<editor>: Editor backup files and state (optional)

Purpose

These directories contain saved files generated by anyunexpected termination of an editor (e.g., elvis, jove, nvi).

Other editors may not require a directory for crash-recoveryfiles, but may require a well-defined place to store other information whilethe editor is running. This information should be stored in a subdirectoryunder /var/lib (for example, GNU Emacs would place lock files in /var/lib/emacs/lock).

Future editors may require additional state informationbeyond crash-recovery files and lock files — thisinformation should also be placed under /var/lib/<editor>.

Rationale

 

Previous Linux releases, as well as all commercial vendors, use /var/preserve for vi or its clones. However, each editor uses its own format for these crash-recovery files, so a separate directory is needed for each editor.

Editor-specific lock files are usually quite different from the device or resource lock files that are stored in /var/lock and, hence, are stored under /var/lib.


/var/lib/hwclock: State directory for hwclock (optional)

Purpose

This directory contains the file /var/lib/hwclock/adjtime.

Rationale

 

In FHS 2.1, this file was /etc/adjtime, but as hwclock updates it, that was obviously incorrect.


/var/lib/misc: Miscellaneous variable data

Purpose

This directory contains variable data not placed in asubdirectory in /var/lib. An attempt should be made to use relatively uniquenames in this directory to avoid namespace conflicts. [39]


/var/lock : Lock files

Purpose

Lock files should be stored within the /var/lockdirectory structure.

Lock files for devices and other resources shared bymultiple applications, such as the serial device lock files that wereoriginally found in either /usr/spool/locks or /usr/spool/uucp,must now be stored in /var/lock. The naming convention which must be usedis "LCK.." followed by the base name of the device. For example, tolock /dev/ttyS0 the file "LCK..ttyS0" would be created. [40]

The format used for the contents of such lock files must bethe HDB UUCP lock file format. The HDB format is to store the processidentifier (PID) as a ten byte ASCII decimal number, with a trailing newline.For example, if process 1230 holds a lock file, it would contain the elevencharacters: space, space, space, space, space, space, one, two, three, zero,and newline.


/var/log : Log filesand directories

Purpose

This directory contains miscellaneous log files. Most logsmust be written to this directory or an appropriate subdirectory.


Specific Options

The following files, or symbolic links to files, must be in/var/log, if the corresponding subsystem is installed:

File

Description

lastlog

record of last login of each user

messages

system messages from syslogd

wtmp

record of all logins and logouts


/var/mail : User mailboxfiles (optional)

Purpose

The mail spool must be accessible through /var/mailand the mail spool files must take the form <username>. [41]

User mailbox files in this location must be stored in thestandard UNIX mailbox format.

Rationale

 

The logical location for this directory was changed from /var/spool/mail in order to bring FHS in-line with nearly every UNIX implementation. This change is important for inter-operability since a single /var/mail is often shared between multiple hosts and multiple UNIX implementations (despite NFS locking issues).

It is important to note that there is no requirement to physically move the mail spool to this location. However, programs and header files must be changed to use /var/mail.


/var/opt : Variable datafor /opt

Purpose

Variable data of the packages in /opt must beinstalled in /var/opt/<subdir>, where <subdir> isthe name of the subtree in /opt where the static data from an add-onsoftware package is stored, except where superseded by another file in /etc.No structure is imposed on the internal arrangement of /var/opt/<subdir>.

Rationale

 

Refer to the rationale for /opt.


/var/run : Run-timevariable data

Purpose

This directory contains system information data describingthe system since it was booted. Files under this directory must be cleared(removed or truncated as appropriate) at the beginning of the boot process.Programs may have a subdirectory of /var/run; this is encouraged forprograms that use more than one run-time file. [42] Process identifier (PID) files, which wereoriginally placed in /etc, must be placed in /var/run. Thenaming convention for PID files is <program-name>.pid. Forexample, the crond PID file is named /var/run/crond.pid.


Requirements

The internal format of PID files remains unchanged. Thefile must consist of the process identifier in ASCII-encoded decimal, followedby a newline character. For example, if crond was process number 25, /var/run/crond.pidwould contain three characters: two, five, and newline.

Programs that read PID files should be somewhat flexible inwhat they accept; i.e., they should ignore extra whitespace, leading zeroes,absence of the trailing newline, or additional lines in the PID file. Programsthat create PID files should use the simple specification located in the aboveparagraph.

The utmp file, which stores information about whois currently using the system, is located in this directory.

System programs that maintain transient UNIX-domain socketsmust place them in this directory.


/var/spool :Application spool data

Purpose

/var/spool contains datawhich is awaiting some kind of later processing. Data in /var/spoolrepresents work to be done in the future (by a program, user, oradministrator); often data is deleted after it has been processed. [43]


Specific Options

The following directories, or symbolic links todirectories, must be in /var/spool, if the corresponding subsystem isinstalled:

Directory

Description

lpd

Printer spool directory (optional)

mqueue

Outgoing mail queue (optional)

news

News spool directory (optional)

rwho

Rwhod files (optional)

uucp

Spool directory for UUCP (optional)


/var/spool/lpd: Line-printer daemon print queues (optional)

Purpose

The lock file for lpd, lpd.lock, must beplaced in /var/spool/lpd. It is suggested that the lock file for eachprinter be placed in the spool directory for that specific printer and named lock.


Specific Options

Directory

Description

printer

Spools for a specific printer (optional)


/var/spool/rwho : Rwhodfiles (optional)

Purpose

This directory holds the rwhod information for othersystems on the local net.

Rationale

 

Some BSD releases use /var/rwho for this data; given its historical location in /var/spool on other systems and its approximate fit to the definition of `spooled‘ data, this location was deemed more appropriate.


/var/tmp :Temporary files preserved between system reboots

Purpose

The /var/tmp directory is made available forprograms that require temporary files or directories that are preserved betweensystem reboots. Therefore, data stored in /var/tmp is more persistentthan data in /tmp.

Files and directories located in /var/tmp must notbe deleted when the system is booted. Although data stored in /var/tmpis typically deleted in a site-specific manner, it is recommended thatdeletions occur at a less frequent interval than /tmp.


/var/yp : NetworkInformation Service (NIS) database files (optional)

Purpose

Variable data for the Network Information Service (NIS),formerly known as the Sun Yellow Pages (YP), must be placed in this directory.

Rationale

 

/var/yp is the standard directory for NIS (YP) data and is almost exclusively used in NIS documentation and systems. [44]


Chapter 6.Operating System Specific Annex

This section is for additional requirements andrecommendations that only apply to a specific operating system. The material inthis section should never conflict with the base standard.


Linux

This is the annex for the Linux operating system.


/ : Root directory

On Linux systems, if the kernel is located in /,we recommend using the names vmlinux or vmlinuz, which havebeen used in recent Linux kernel source packages.


/bin : Essentialuser command binaries (for use by all users)

Linux systems which require them place these additionalfiles into /bin:

·        setserial


/dev : Devices andspecial files

The following devices must exist under /dev.

/dev/null

All data written to this deviceis discarded. A read from this device will return an EOF condition.

/dev/zero

This device is a source ofzeroed out data. All data written to this device is discarded. A read from thisdevice will return as many bytes containing the value zero as was requested.

/dev/tty

This device is a synonym for thecontrolling terminal of a process. Once this device is opened, all reads andwrites will behave as if the actual controlling terminal device had beenopened.

Rationale

 

Previous versions of the FHS had stricter requirements for /dev. Other devices may also exist in /dev. Device names may exist as symbolic links to other device nodes located in /dev or subdirectories of /dev. There is no requirement concerning major/minor number values.


/etc :Host-specific system configuration

Linux systems which require them place these additionalfiles into /etc.

·        lilo.conf


/lib64 and /lib32 : 64/32-bit libraries (architecturedependent)

The 64-bit architectures PPC64, s390x, sparc64 and AMD64must place 64-bit libraries in /lib64, and 32-bit (or 31-bit on s390)libraries in /lib.

The 64-bit architecture IA64 must place 64-bit libraries in/lib.

Rationale

 

This is a refinement of the general rules for /lib<qual> and /usr/lib<qual>. The architectures PPC64, s390x, sparc64 and AMD64 support support both 32-bit (for s390 more precise 31-bit) and 64-bit programs. Using lib for 32-bit binaries allows existing binaries from the 32-bit systems to work without any changes: such binaries are expected to be numerous. IA-64 uses a different scheme, reflecting the deprecation of 32-bit binaries (and hence libraries) on that architecture.


/proc : Kerneland process information virtual filesystem

The proc filesystem is the de-facto standard Linuxmethod for handling process and system information, rather than /dev/kmemand other similar methods. We strongly encourage this for the storage andretrieval of process information as well as other kernel and memoryinformation.


/sbin : Essentialsystem binaries

Linux systems place these additional files into /sbin.

·        Second extended filesystemcommands (optional):

·        badblocks

·        dumpe2fs

·        e2fsck

·        mke2fs

·        mklost+found

·        tune2fs

·        Boot-loader map installer(optional):

·        lilo

Optional files for /sbin:

·        Static binaries:

·        ldconfig

·        sln

·        ssync

Static ln (sln)and static sync (ssync) are useful when things go wrong. Theprimary use of sln (to repair incorrect symlinks in /lib aftera poorly orchestrated upgrade) is no longer a major concern now that the ldconfigprogram (usually located in /usr/sbin) exists and can act as a guidinghand in upgrading the dynamic libraries. Static sync is useful in someemergency situations. Note that these need not be statically linked versions ofthe standard ln and sync, but may be.

The ldconfig binary isoptional for /sbin since a site may choose to run ldconfig atboot time, rather than only when upgrading the shared libraries. (It‘s notclear whether or not it is advantageous to run ldconfig on each boot.)Even so, some people like ldconfig around for the following (all toocommon) situation:

·        I‘ve just removed /lib/<file>.

·        I can‘t find out the name ofthe library because ls is dynamically linked, I‘m using a shell thatdoesn‘t have ls built-in, and I don‘t know about using "echo *"as a replacement.

·        I have a static sln, butI don‘t know what to call the link.

·        Miscellaneous:

·        ctrlaltdel

·        kbdrate

So as to cope with the fact thatsome keyboards come up with such a high repeat rate as to be unusable, kbdratemay be installed in /sbin on some systems.

Since the default action in thekernel for the Ctrl-Alt-Del key combination is an instant hard reboot, it isgenerally advisable to disable the behavior before mounting the root filesystemin read-write mode. Some init suites are able to disable Ctrl-Alt-Del,but others may require the ctrlaltdel program, which may be installed in/sbin on those systems.


/usr/include :Header files included by C programs

These symbolic links are required if a C or C++ compiler isinstalled and only for systems not based on glibc.

    /usr/include/asm -> /usr/src/linux/include/asm-<arch>
    /usr/include/linux -> /usr/src/linux/include/linux

/usr/src : Source code

For systems based on glibc, there are no specific guidelinesfor this directory. For systems based on Linux libc revisions prior to glibc,the following guidelines and rationale apply:

The only source code that should be placed in a specificlocation is the Linux kernel source code. It is located in /usr/src/linux.

If a C or C++ compiler is installed, but the complete Linuxkernel source code is not installed, then the include files from the kernelsource code must be located in these directories:

    /usr/src/linux/include/asm-<arch>
    /usr/src/linux/include/linux

<arch> is the nameof the system architecture.

Note

 

/usr/src/linux may be a symbolic link to a kernel source code tree.

Rationale

 

It is important that the kernel include files be located in /usr/src/linux and not in /usr/include so there are no problems when system administrators upgrade their kernel version for the first time.


/var/spool/cron : cronand at jobs

This directory contains the variable data for the cronand at programs.


Chapter 7. Appendix

The FHS mailing list

The FHS mailing list is located at<freestandards-fhs-discuss@lists.sourceforge.net>. You can subscribe tothe mailing list at this page http://sourceforge.net/projects/freestandards/.

Thanks to Network Operations at the University ofCalifornia at San Diego who allowed us to use their excellent mailing listserver.

As noted in the introduction, please do not send mail tothe mailing list without first contacting the FHS editor or a listedcontributor.


Background of the FHS

The process of developing a standard filesystem hierarchybegan in August 1993 with an effort to restructure the file and directorystructure of Linux. The FSSTND, a filesystem hierarchy standard specific to theLinux operating system, was released on February 14, 1994. Subsequent revisionswere released on October 9, 1994 and March 28, 1995.

In early 1995, the goal of developing a more comprehensiveversion of FSSTND to address not only Linux, but other UNIX-like systems wasadopted with the help of members of the BSD development community. As a result,a concerted effort was made to focus on issues that were general to UNIX-likesystems. In recognition of this widening of scope, the name of the standard waschanged to Filesystem Hierarchy Standard or FHS for short.

Volunteers who have contributed extensively to thisstandard are listed at the end of this document. This standard represents a consensusview of those and other contributors.


General Guidelines

Here are some of the guidelines that have been used in thedevelopment of this standard:

·        Solve technical problems whilelimiting transitional difficulties.

·        Make the specificationreasonably stable.

·        Gain the approval ofdistributors, developers, and other decision-makers in relevant developmentgroups and encourage their participation.

·        Provide a standard that isattractive to the implementors of different UNIX-like systems.


Scope

This document specifies a standard filesystem hierarchy forFHS filesystems by specifying the location of files and directories, and thecontents of some system files.

This standard has been designed to be used by systemintegrators, package developers, and system administrators in the constructionand maintenance of FHS compliant filesystems. It is primarily intended to be areference and is not a tutorial on how to manage a conforming filesystemhierarchy.

The FHS grew out of earlier work on FSSTND, a filesystem organizationstandard for the Linux operating system. It builds on FSSTND to addressinteroperability issues not just in the Linux community but in a wider arenaincluding 4.4BSD-based operating systems. It incorporates lessons learned inthe BSD world and elsewhere about multi-architecture support and the demands ofheterogeneous networking.

Although this standard is more comprehensive than previousattempts at filesystem hierarchy standardization, periodic updates may becomenecessary as requirements change in relation to emerging technology. It is alsopossible that better solutions to the problems addressed here will bediscovered so that our solutions will no longer be the best possible solutions.Supplementary drafts may be released in addition to periodic updates to thisdocument. However, a specific goal is backwards compatibility from one releaseof this document to the next.

Comments related to this standard are welcome. Any commentsor suggestions for changes may be directed to the FHS editor (Daniel Quinlan<quinlan@pathname.com>) or the FHS mailing list. Typographical orgrammatical comments should be directed to the FHS editor.

Before sending mail to the mailing list it is requestedthat you first contact the FHS editor in order to avoid excessive re-discussionof old topics.

Questions about how to interpret items in this document mayoccasionally arise. If you have need for a clarification, please contact theFHS editor. Since this standard represents a consensus of many participants, itis important to make certain that any interpretation also represents theircollective opinion. For this reason it may not be possible to provide animmediate response unless the inquiry has been the subject of previousdiscussion.


Acknowledgments

The developers of the FHS wish to thank the developers,system administrators, and users whose input was essential to this standard. Wewish to thank each of the contributors who helped to write, compile, andcompose this standard.

The FHS Group also wishes to thank those Linux developerswho supported the FSSTND, the predecessor to this standard. If they hadn‘tdemonstrated that the FSSTND was beneficial, the FHS could never have evolved.


Contributors

Brandon S. Allbery

<bsa@kf8nh.wariat.org>

Keith Bostic

<bostic@cs.berkeley.edu>

Drew Eckhardt

<drew@colorado.edu>

Rik Faith

<faith@cs.unc.edu>

Stephen Harris

<sweh@spuddy.mew.co.uk>

Ian Jackson

<ijackson@cus.cam.ac.uk>

Andreas Jaeger

<aj@suse.de>

John A. Martin

<jmartin@acm.org>

Ian McCloghrie

<ian@ucsd.edu>

Chris Metcalf

<metcalf@lcs.mit.edu>

Ian Murdock

<imurdock@debian.org>

David C. Niemi

<niemidc@clark.net>

Daniel Quinlan

<quinlan@pathname.com>

Eric S. Raymond

<esr@thyrsus.com>

Rusty Russell

<rusty@rustcorp.com.au>

Mike Sangrey

<mike@sojurn.lns.pa.us>

David H. Silber

<dhs@glowworm.firefly.com>

Thomas Sippel-Dau

<t.sippel-dau@ic.ac.uk>

Theodore Ts‘o

<tytso@athena.mit.edu>

Stephen Tweedie

<sct@dcs.ed.ac.uk>

Fred N. van Kempen

<waltje@infomagic.com>

Bernd Warken

<bwarken@mayn.de>

Christopher Yeoh

<cyeoh@samba.org>

Notes

[1]

Command binaries that are not essential enough to place into /bin must be placed in /usr/bin, instead. Items that are required only by non-root users (the X Window System, chsh, etc.) are generally not essential enough to be placed into the root partition.

[2]

Programs necessary to arrange for the boot loader to be able to boot a file must be placed in /sbin. Configuration files for boot loaders must be placed in /etc.

The GRUB bootloader reads its configurations file before booting, so that must be placed in /boot. However, it is a configuration file, so should be in /etc. The answer here is a symbolic link such as /etc/grub/menu.lst -> /boot/menu.lst.

[3]

On some i386 machines, it may be necessary for /boot to be located on a separate partition located completely below cylinder 1024 of the boot device due to hardware constraints.

Certain MIPS systems require a /boot partition that is a mounted MS-DOS filesystem or whatever other filesystem type is accessible for the firmware. This may result in restrictions with respect to usable filenames within /boot (only for affected systems).

[4]

The setup of command scripts invoked at boot time may resemble System V, BSD or other models. Further specification in this area may be added to a future version of this standard.

[5]

It is recommended that files be stored in subdirectories of /etc rather than directly in /etc.

[6]

Systems that use the shadow password suite will have additional configuration files in /etc (/etc/shadow and others) and programs in /usr/sbin (useradd, usermod, and others).

[7]

On some Linux systems, this may be a symbolic link to /proc/mounts, in which case this exception is not required.

[8]

/etc/X11/xdm holds the configuration files for xdm. These are most of the files previously found in /usr/lib/X11/xdm. Some local variable data for xdm is stored in /var/lib/xdm.

[9]

Different people prefer to place user accounts in a variety of places. This section describes only a suggested placement for user home directories; nevertheless we recommend that all FHS-compliant distributions use this as the default location for home directories.

On small systems, each user‘s directory is typically one of the many subdirectories of /home such as /home/smith, /home/torvalds, /home/operator, etc. On large systems (especially when the /home directories are shared amongst many hosts using NFS) it is useful to subdivide user home directories. Subdivision may be accomplished by using subdirectories such as /home/staff, /home/guests, /home/students, etc.

[10]

If you want to find out a user‘s home directory, you should use the getpwent(3) library function rather than relying on /etc/passwd because user information may be stored remotely using systems such as NIS.

[11]

It is recommended that apart from autosave and lock files programs should refrain from creating non dot files or directories in a home directory without user intervention.

[12]

Shared libraries that are only necessary for binaries in /usr (such as any X Window binaries) must not be in /lib. Only the shared libraries required to run binaries in /bin and /sbin may be here. In particular, the library libm.so.* may also be placed in /usr/lib if it is not required by anything in /bin or /sbin.

[13]

The usual placement of this binary is /usr/bin/cpp.

[14]

This is commonly used for 64-bit or 32-bit support on systems which support multiple binary formats, but require libraries of the same name. In this case, /lib32 and /lib64 might be the library directories, and /lib a symlink to one of them.

[15]

/lib<qual>/cpp is still permitted: this allows the case where /lib and /lib<qual> are the same (one is a symbolic link to the other).

[16]

A compliant implementation with two CDROM drives might have /media/cdrom0 and /media/cdrom1 with /media/cdrom a symlink to either of these.

[17]

If the home directory of the root account is not stored on the root partition it will be necessary to make certain it will default to / if it can not be located.

We recommend against using the root account for tasks that can be performed as an unprivileged user, and that it be used solely for system administration. For this reason, we recommend that subdirectories for mail and other applications not appear in the root account‘s home directory, and that mail for administration roles such as root, postmaster, and webmaster be forwarded to an appropriate user.

[18]

Originally, /sbin binaries were kept in /etc.

[19]

Deciding what things go into "sbin" directories is simple: if a normal (not a system administrator) user will ever run it directly, then it must be placed in one of the "bin" directories. Ordinary users should not have to place any of the sbin directories in their path.

For example, files such as chfn which users only occasionally use must still be placed in /usr/bin. ping, although it is absolutely necessary for root (network recovery and diagnosis) is often used by users and must live in /bin for that reason.

We recommend that users have read and execute permission for everything in /sbin except, perhaps, certain setuid and setgid programs. The division between /bin and /sbin was not created for security reasons or to prevent users from seeing the operating system, but to provide a good partition between binaries that everyone uses and ones that are primarily used for administration tasks. There is no inherent security advantage in making /sbin off-limits for users.

[20]

This is particularly important as these areas will often contain both files initially installed by the distributor, and those added by the administrator.

[21]

Examples of such configuration files include Xconfig, XF86Config, or system.twmrc)

[22]

Miscellaneous architecture-independent application-specific static files and subdirectories must be placed in /usr/share.

[23]

For example, the perl5 subdirectory for Perl 5 modules and libraries.

[24]

Some executable commands such as makewhatis and sendmail have also been traditionally placed in /usr/lib. makewhatis is an internal binary and must be placed in a binary directory; users access only catman. Newer sendmail binaries are now placed by default in /usr/sbin. Additionally, systems using a sendmail-compatible mail transfer agent must provide /usr/sbin/sendmail as a symbolic link to the appropriate executable.

[25]

Host-specific data for the X Window System must not be stored in /usr/lib/X11. Host-specific configuration files such as Xconfig or XF86Config must be stored in /etc/X11. This includes configuration data such as system.twmrc even if it is only made a symbolic link to a more global configuration file (probably in /usr/X11R6/lib/X11).

[26]

The case where /usr/lib and /usr/lib<qual> are the same (one is a symbolic link to the other) these files and the per-application subdirectories will exist.

[27]

Software placed in / or /usr may be overwritten by system upgrades (though we recommend that distributions do not overwrite data in /etc under these circumstances). For this reason, local software must not be placed outside of /usr/local without good reason.

[28]

/usr/local/man may be deprecated in future FHS releases, so if all else is equal, making that one a symlink seems sensible.

[29]

Locally installed system administration programs should be placed in /usr/local/sbin.

[30]

Much of this data originally lived in /usr (man, doc) or /usr/lib (dict, terminfo, zoneinfo).

[31]

Obviously, there are no manual pages in / because they are not required at boot time nor are they required in emergencies. Really.

[32]

For example, if /usr/local/man has no manual pages in section 4 (Devices), then /usr/local/man/man4 may be omitted.

[33]

A major exception to this rule is the United Kingdom, which is `GB‘ in the ISO 3166, but `UK‘ for most email addresses.

[34]

Some such files include: airport, birthtoken, eqnchar, getopt, gprof.callg, gprof.flat, inter.phone, ipfw.samp.filters, ipfw.samp.scripts, keycap.pcvt, mail.help, mail.tildehelp, man.template, map3270, mdoc.template, more.help, na.phone, nslookup.help, operator, scsi_modes, sendmail.hf, style, units.lib, vgrindefs, vgrindefs.db, zipcodes

[35]

Generally, source should not be built within this hierarchy.

[36]

This standard does not currently incorporate the TeX Directory Structure (a document that describes the layout TeX files and directories), but it may be useful reading. It is located at ftp://ctan.tug.org/tex/

[37]

For example, /usr/share/man/man1/ls.1 is formatted into /var/cache/man/cat1/ls.1, and /usr/X11R6/man/<locale>/man3/XtClass.3x into /var/cache/man/X11R6/<locale>/cat3/XtClass.3x.

[38]

An important difference between this version of this standard and previous ones is that applications are now required to use a subdirectory of /var/lib.

[39]

This hierarchy should contain files stored in /var/db in current BSD releases. These include locate.database and mountdtab, and the kernel symbol database(s).

[40]

Then, anything wishing to use /dev/ttyS0 can read the lock file and act accordingly (all locks in /var/lock should be world-readable).

[41]

Note that /var/mail may be a symbolic link to another directory.

[42]

/var/run should be unwritable for unprivileged users (root or users running daemons); it is a major security problem if any user can write in this directory.

[43]

UUCP lock files must be placed in /var/lock. See the above section on /var/lock.

[44]

NIS should not be confused with Sun NIS+, which uses a different directory, /var/nis.

 


Filesystem-Hierarchy-Standard(FHS) 文件系统层次结构标准2.3中英对照版(未完待续)

标签:

原文地址:http://blog.csdn.net/qq759981398/article/details/42233477

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!