Filesystem Hierarchy Standard
Encyclopedia
The Filesystem Hierarchy Standard (FHS) defines the main directories and their contents in Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s. For the most part, it is a formalization and extension of the traditional BSD filesystem hierarchy
Unix directory structure
In Unix and Unix-like operating systems, the Unix directory structure is a convention for filesystem layout.Several attempts exist to standardize the Unix filesystem layout, such as the "Filesystem Hierarchy Standard," however, it is targeted primarily at Linux...

.

The FHS is maintained by the Linux Foundation
Linux Foundation
The Linux Foundation is a non-profit technology consortium chartered to foster the growth of Linux.Founded in 2007 by the merger of the Open Source Development Labs and the Free Standards Group , the Linux Foundation sponsors the work of Linux creator Linus Torvalds and is supported by leading...

, a non-profit organization consisting of major software and hardware vendors, such as HP, Red Hat
Red Hat
Red Hat, Inc. is an S&P 500 company in the free and open source software sector, and a major Linux distribution vendor. Founded in 1993, Red Hat has its corporate headquarters in Raleigh, North Carolina with satellite offices worldwide....

, IBM
IBM
International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

 and Dell
Dell
Dell, Inc. is an American multinational information technology corporation based in 1 Dell Way, Round Rock, Texas, United States, that develops, sells and supports computers and related products and services. Bearing the name of its founder, Michael Dell, the company is one of the largest...

.

The current version is 2.3, announced on January 29, 2004.

Overview

Most Linux distribution
Linux distribution
A Linux distribution is a member of the family of Unix-like operating systems built on top of the Linux kernel. Such distributions are operating systems including a large collection of software applications such as word processors, spreadsheets, media players, and database applications...

s follow the FHS and declare it their own policy to maintain FHS compliance.

When the FHS was created, other UNIX and Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 operating systems already had their own standards, notably the hier(7) description of file system layout that has existed since the release of Version 7 Unix
Version 7 Unix
Seventh Edition Unix, also called Version 7 Unix, Version 7 or just V7, was an important early release of the Unix operating system. V7, released in 1979, was the last Bell Laboratories release to see widespread distribution before the commercialization of Unix by AT&T in the early 1980s...

 (in 1979), or the SunOS
SunOS
SunOS is a version of the Unix operating system developed by Sun Microsystems for their workstation and server computer systems. The SunOS name is usually only used to refer to versions 1.0 to 4.1.4 of SunOS...

 filesystem(7), later Solaris filesystem(5).

Modern Linux distributions include a /sys directory as a virtual filesystem (sysfs
Sysfs
Sysfs is a virtual file system provided by Linux 2.6. Sysfs exports information about devices and drivers from the kernel device model to user space, and is also used for configuration...

, comparable to /proc, which is a procfs
Procfs
procfs is a special filesystem in UNIX-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional...

), which stores and allows modification of the devices connected to the system, whereas many traditional UNIX and Unix-like operating systems use /sys as a symbolic link
Symbolic link
In computing, a symbolic link is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution. Symbolic links were already present by 1978 in mini-computer operating systems from DEC and Data...

 to the kernel
Kernel (computing)
In computing, the kernel is the main component of most computer operating systems; it is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources...

 source tree.

Some Linux systems such as GoboLinux
GoboLinux
GoboLinux is a free and open source operating system whose most prominent feature is a reorganization of the traditional Linux file system. Rather than following the Filesystem Hierarchy Standard like most Unix-like systems, each program in a GoboLinux system has its own subdirectory tree, where...

 and Syllable Server
Syllable (operating system)
Syllable Desktop is a free and open source operating system for Pentium and compatible processors. Its purpose is to create an easy-to-use desktop operating system for the home and small office user...

 use a completely different approach from the FHS.

History

The process of developing a standard filesystem
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

 hierarchy began in August 1993 with an effort to restructure the file and directory structure of Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

. The FSSTND (Filesystem Standard), a filesystem hierarchy standard specific to the Linux operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

, was released on 14 February 1994. Subsequent revisions were released on 9 October 1994 and 28 March 1995.

In early 1996, the goal of developing a more comprehensive version of FSSTND to address not only Linux, but other Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 systems was adopted 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-like systems. In recognition of this widening of scope, the name of the standard was changed to Filesystem Hierarchy Standard.

Release history

Meaning
Red Old Standard/Draft; not supported
Yellow Old Standard; still supported
Green Current Standard
Blue Future Draft

Version Release Date Notes
v1.0 1994-02-14 FSSTND
v1.1 1994-10-09 FSSTND
v1.2 1995-03-28 FSSTND
v2.0 1997-10-26 FHS 2.0 is the direct successor for FSSTND 1.2. Name of the standard was changed to Filesystem Hierarchy Standard.
v2.1 2000-04-12 FHS
v2.2 2001-05-23 FHS
v2.3 2004-01-29 FHS
v3.0 TBA FHS

Directory structure

In the FHS all files and directories
Directory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...

 appear under the root directory
Root directory
In computer file systems, the root directory is the first or top-most directory in a hierarchy. It can be likened to the root of a tree — the starting point where all branches originate.-Metaphor:...

 "/", even if they are stored on different physical devices. Note however that some of these directories may or may not be present on a Unix system depending on whether certain subsystems, such as the X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

, are installed.

The majority of these directories exist in all UNIX operating systems and are generally used in much the same way; however, the descriptions here are those used specifically for the FHS, and are not considered authoritative for platforms other than Linux.
Directory Description
/ Primary hierarchy root and root directory
Root directory
In computer file systems, the root directory is the first or top-most directory in a hierarchy. It can be likened to the root of a tree — the starting point where all branches originate.-Metaphor:...

 of the entire file system hierarchy.
/bin/ Essential command binaries
Executable
In computing, an executable file causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a data file that must be parsed by a program to be meaningful. These instructions are traditionally machine code instructions for a physical CPU...

 that need to be available in single user mode
Single user mode
Single user mode is a mode in which a multiuser computer operating system boots into a single superuser. It is mainly used for maintenance of multi-user environments such as network servers. Some tasks may require exclusive access to shared resources, for example running fsck on a network share...

; for all users, e.g., cat
Cat (Unix)
The cat command is a standard Unix program used to concatenate and display files. The name is from catenate, a synonym of concatenate.- Specification :...

, ls
Ls
In computing, ls is a command to list files in Unix and Unix-like operating systems. ls is specified by POSIX and the Single UNIX Specification.- History :An ls utility appeared in the original version of AT&T UNIX...

, cp
Cp (Unix)
cp is a UNIX command used to copy a file. Files can be copied either to the same directory or to a completely different directory, possibly on a different file system or hard disk drive. If the file is copied to the same directory, the new file must have a different name to the original; in all...

.
/boot/
/boot/
In Linux, and other Unix-like operating systems, the /boot/ file directory holds files used in booting Linux. The usage is standardized in the Filesystem Hierarchy Standard.- Contents :...

Boot loader files, e.g., kernels, initrd
Initrd
In computing, initrd is a scheme for loading a temporary file system into memory in the boot process of the Linux kernel. initrd and initramfs refer to slightly different methods of achieving this...

; often a separate partition
/dev/ Essential devices, e.g., :/dev/null.
/etc/ Host-specific system-wide configuration file
Configuration file
In computing, configuration files, or config files configure the initial settings for some computer programs. They are used for user applications, server processes and operating system settings. The files are often written in ASCII and line-oriented, with lines terminated by a newline or carriage...

s

There has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell labs, /etc is referred to as the etcetera
Et cetera
Et cetera is a Latin expression that means "and other things", or "and so forth". It is taken directly from the Latin expression which literally means "and the rest " and is a loan-translation of the Greek "καὶ τὰ ἕτερα"...

 directory
, as this directory historically held everything that did not belong elsewhere (however, the FHS restricts /etc to static configuration files and may not contain binaries). Since the publication of early documentation, the directory name has been re-designated in various ways. Recent interpretations include Backronyms
Backronym
A backronym or bacronym is a phrase constructed purposely, such that an acronym can be formed to a specific desired word. Backronyms may be invented with serious or humorous intent, or may be a type of false or folk etymology....

 such as "Editable Text Configuration" or "Extended Tool Chest".
/etc/opt/
Configuration files for /opt/.
/etc/X11/
Configuration files for the X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

, version 11.
/etc/sgml/
Configuration files for SGML.
/etc/xml/
Configuration files for XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

.
/home/ Users' home directories
Home directory
A Home directory is a file system directory on a multi-user operating system containing files for a given user of the system. The specifics of the home directory is defined by the operating system involved; for example, Windows systems between 2000 and 2003 keep home directories in a folder...

, containing saved files, personal settings, etc.; often a separate partition.
/lib/ Libraries
Library (computer science)
In computer science, a library is a collection of resources used to develop software. These may include pre-written code and subroutines, classes, values or type specifications....

 essential for the binaries in /bin/ and /sbin/.
/media/ Mount points for removable media such as CD-ROM
CD-ROM
A CD-ROM is a pre-pressed compact disc that contains data accessible to, but not writable by, a computer for data storage and music playback. The 1985 “Yellow Book” standard developed by Sony and Philips adapted the format to hold any form of binary data....

s (appeared in FHS-2.3).
/mnt/ Temporarily mounted
Mount (computing)
Mounting takes place before a computer can use any kind of storage device . The user or their operating system must make it accessible through the computer's file system. A user can access only files on mounted media.- Mount point :A mount point is a physical location in the partition used as a...

 filesystems.
/opt/ Optional application software
Application software
Application software, also known as an application or an "app", is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with...

 packages
Software package (installation)
In package management systems, which are commonly used with Linux-based operating systems, a package is a specific piece of software which the system can install and uninstall....

.
/proc/ Virtual filesystem
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

 documenting kernel and process
Process (computing)
In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system , a process may be made up of multiple threads of execution that execute instructions concurrently.A computer program is a...

 status as text files, e.g., uptime, network. In Linux, corresponds to a Procfs
Procfs
procfs is a special filesystem in UNIX-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional...

 mount.
/root/ Home directory
Home directory
A Home directory is a file system directory on a multi-user operating system containing files for a given user of the system. The specifics of the home directory is defined by the operating system involved; for example, Windows systems between 2000 and 2003 keep home directories in a folder...

 for the root
Superuser
On many computer operating systems, the superuser is a special user account used for system administration. Depending on the operating system, the actual name of this account might be: root, administrator or supervisor....

 user.
/sbin/ Essential system binaries, e.g., init, ip, mount.
/srv/ Site-specific data
Data
The term data refers to qualitative or quantitative attributes of a variable or set of variables. Data are typically the results of measurements and can be the basis of graphs, images, or observations of a set of variables. Data are often viewed as the lowest level of abstraction from which...

 which is served by the system.
/tmp/ Temporary files (see also /var/tmp). Often not preserved between system reboots.
/usr/ Secondary hierarchy for read-only user data; contains the majority of (multi-
Multi-user
Multi-user is a term that defines an operating system or application software that allows concurrent access by multiple users of a computer. Time-sharing systems are multi-user systems. Most batch processing systems for mainframe computers may also be considered "multi-user", to avoid leaving the...

)user utilities and applications.
/usr/bin/
Non-essential command binaries
Executable
In computing, an executable file causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a data file that must be parsed by a program to be meaningful. These instructions are traditionally machine code instructions for a physical CPU...

 (not needed in single user mode
Single user mode
Single user mode is a mode in which a multiuser computer operating system boots into a single superuser. It is mainly used for maintenance of multi-user environments such as network servers. Some tasks may require exclusive access to shared resources, for example running fsck on a network share...

); for all users.
/usr/include/
Standard include files
Header file
Some programming languages use header files. These files allow programmers to separate certain elements of a program's source code into reusable files. Header files commonly contain forward declarations of classes, subroutines, variables, and other identifiers...

.
/usr/lib/
Libraries
Library (computer science)
In computer science, a library is a collection of resources used to develop software. These may include pre-written code and subroutines, classes, values or type specifications....

 for the binaries in /usr/bin/ and /usr/sbin/.
/usr/sbin/
Non-essential system binaries, e.g., daemons
Daemon (computer software)
In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

 for various network-services.
/usr/share/
Architecture-independent (shared) data.
/usr/src/
Source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

, e.g., the kernel source code with its header files.
/usr/X11R6/
X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

, Version 11, Release 6.
/usr/local/
Tertiary hierarchy for local data, specific to this host. Typically has further subdirectories, e.g., bin/, lib/, share/.
/var/ Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files. Sometimes a separate partition.
/var/cache/
Application cache data. Such data is locally generated as a result of time-consuming I/O or calculation. The application must be able to regenerate or restore the data. The cached files can be deleted without data loss
/var/lib/
State information. Persistent data modified by programs as they run, e.g., databases, packaging system metadata, etc.
/var/lock/
Lock files. Files keeping track of resources currently in use.
/var/log/
Log files. Various logs.
/var/mail/
Users' mail
E-mail
Electronic mail, commonly known as email or e-mail, is a method of exchanging digital messages from an author to one or more recipients. Modern email operates across the Internet or other computer networks. Some early email systems required that the author and the recipient both be online at the...

boxes.
/var/run/
Information about the running system since last boot, e.g., currently logged-in users and running daemons
Daemon (computer software)
In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

.
/var/spool/
Spool
Spooling
In computer science, spool refers to the process of placing data in a temporary working area for another program to process. The most common use is in writing files on a magnetic tape or disk and entering them in the work queue for another process. Spooling is useful because devices access data at...

 for tasks waiting to be processed, e.g., print queues and unread mail.
/var/spool/mail/
Deprecated location for users' mailboxes.
/var/tmp/
Temporary files to be preserved between reboots.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK