The Filesystem Hierarchy Standard (FHS) is a reference describing the conventions used for the layout of Unix-like systems. It has been made popular by its use in Linux distributions, but it is used by other Unix-like systems as well. The latest version of the standard, version 3.0, was originally released on 3 June 2015 by the Linux Foundation. It was republished on 6 November 2025 by FreeDesktop, which has since assumed maintenance of the specification.

Directory structure

300px|thumb|Filesystem hierarchy in [[openSUSE]]

In the FHS, all files and directories appear under the root directory <code>/</code>, even if they are stored on different physical or virtual devices. Some of these directories only exist in a particular system if certain subsystems, such as the X Window System, are installed.

Most of these directories exist in all Unix-like 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.

{| class="wikitable" summary="A description of the hierarchy specified in the FHS."

|-

!Directory

!Description

|-

|<code>/</code>

|Primary hierarchy root and root directory of the entire file system hierarchy.

|-

|<code>/bin</code>

|Essential command binaries that need to be available in single-user mode, including to bring up the system or repair it, for all users (e.g., cat, ls, cp).

|-

|<code>/boot</code>

|Boot loader files (e.g., kernels, initrd).

|-

|<code>/dev</code>

|Device files (e.g., <code>/dev/null</code>, <code>/dev/disk0</code>, <code>/dev/sda1</code>, <code>/dev/tty</code>, <code>/dev/random</code>).

|-

|<code>/etc</code>

<!-- Please see the talk page before changing this -->

|Host-specific system-wide configuration files.<br />

There has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell Labs, <code>/etc</code> is referred to as the etcetera directory, as this directory historically held everything that did not belong elsewhere (however, the FHS restricts <code>/etc</code> to static configuration files and may not contain binaries). Since the publication of early documentation, the directory name has been re-explained in various ways. Later interpretations include backronyms such as "Editable Text Configuration" or "Extended Tool Chest".

|-

|<code>/etc/opt</code>

|Configuration files for add-on packages stored in <code>/opt</code>.

|-

|<code>/etc/sgml</code>

|Configuration files, such as catalogs, for software that processes SGML.

|-

|<code>/etc/X11</code>

|Configuration files for the X Window System, version 11.

|-

|<code>/etc/xml</code>

|Configuration files, such as catalogs, for software that processes XML.

|-

|<code>/home</code>

|Users' home directories, containing saved files, personal settings, etc.

|-

|<code>/lib</code>

|Libraries essential for the binaries in <code>/bin</code> and <code>/sbin</code>.

|-

|<code>/lib&lt;qual&gt;</code>

|Alternate format essential libraries. These are typically used on systems that support more than one executable code format, such as systems supporting 32-bit and 64-bit versions of an instruction set. Such directories are optional, but if they exist, they have some requirements.

|-

|<code>/media</code>

|Mount points for removable media such as CD-ROMs (appeared in FHS-2.3 in 2004).

|-

|<code>/mnt</code>

|Temporarily mounted filesystems.

|-

|<code>/opt</code>

|Add-on application software packages.

|-

|<code>/proc</code>

|Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procfs mount. Generally, automatically generated and populated by the system, on the fly.

|-

|<code>/root</code>

|Home directory for the root user.

|-

|<code>/run</code>

|Run-time variable data: Information about the running system since last boot, e.g., currently logged-in users and running daemons. Files under this directory must be either removed or truncated at the beginning of the boot process, but this is not necessary on systems that provide this directory as a temporary filesystem (tmpfs) (appeared in FHS-3.0 in 2015).

|-

|<code>/sbin</code>

|Essential system binaries (e.g., fsck, init, route).

|-

|<code>/srv</code>

|Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems (appeared in FHS-2.3 in 2004).

|-

|<code>/sys</code>

|Contains information about devices, drivers, and some kernel features.

|-

|<code>/tmp</code>

|Directory for temporary files (see also <code>/var/tmp</code>). Often not preserved between system reboots and may be severely size-restricted.

|-

|<code>/usr</code>

<!-- ##### Please SEE THE TALK PAGE before changing this ##### -->

|Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications. Should be shareable and read-only.

<!-- ##### /usr is NOT anything but the above. This has been rehashed plenty of times before and reverting misled souls like yourself is taking up roughly a third of every edit on this page (another third being the edits of misled souls such as yourself). This time, Wikipedia is right. ##### -->

|-

|<code>/usr/bin</code>

|Non-essential command binaries (not needed in single-user mode); for all users.

|-

|<code>/usr/include</code>

|Standard include files.

|-

|<code>/usr/lib</code>

|Libraries for the binaries in <code>/usr/bin</code> and <code>/usr/sbin</code>.

|-

|<code>/usr/libexec</code>

|Binaries run by other programs that are not intended to be executed directly by users or shell scripts (optional).

|-

|<code>/usr/lib&lt;qual&gt;</code>

|Alternative-format libraries (e.g., <code>/usr/lib32</code> for 32-bit libraries on a 64-bit machine (optional)).

|-

|<code>/usr/local</code>

|Tertiary hierarchy for local data, specific to this host. Typically has further subdirectories (e.g., <code>bin</code>, <code>lib</code>, <code>share</code>).

|-

|<code>/usr/sbin</code>

|Non-essential system binaries (e.g., daemons for various network services).

|-

|<code>/usr/share</code>

|Architecture-independent (shared) data.

|-

|<code>/usr/src</code>

|Source code (e.g., the kernel source code with its header files).

|-

|<code>/usr/X11R6</code>

|X Window System, Version 11, Release 6 (up to FHS-2.3, optional).

|-

|<code>/var</code>

|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.

|-

|<code>/var/cache</code>

|Application cache data. Such data are 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 loss of data.

|-

|<code>/var/lib</code>

|State information. Persistent data modified by programs as they run (e.g., databases, packaging system metadata, etc.).

|-

|<code>/var/lock</code>

|Lock files. Files keeping track of resources currently in use.

|-

|<code>/var/log</code>

|Log files. Various logs.

|-

|<code>/var/mail</code>

|Mailbox files. In some distributions, these files may be located in the deprecated <code>/var/spool/mail</code>.

|-

|<code>/var/opt</code>

|Variable data from add-on packages that are stored in <code>/opt</code>.

|-

|<code>/var/run</code>

|Run-time variable data. This directory contains system information data describing the system since it was booted.<br />

In FHS 3.0, <code>/var/run</code> is replaced by <code>/run</code>; a system should either continue to provide a <code>/var/run</code> directory or provide a symbolic link from <code>/var/run</code> to <code>/run</code> for backward compatibility.

|-

|<code>/var/spool</code>

|Spool for tasks waiting to be processed (e.g., print queues and outgoing mail queue). Formerly also contained user mailbox files at <code>/var/spool/mail</code>.

|-

|<code>/var/tmp</code>

|Temporary files to be preserved between reboots.

|}

FHS compliance

Most Linux distributions follow the Filesystem Hierarchy Standard and declare it their own policy to maintain FHS compliance. GoboLinux and NixOS provide examples of intentionally non-compliant filesystem implementations.

Some distributions generally follow the standard but deviate from it in some areas. The FHS is a "trailing standard", and so documents common practices at a point in time. Of course, times change, and distribution goals and needs call for experimentation. Some common deviations include:

  • Modern Linux distributions include a <code>/sys</code> directory as a virtual filesystem (sysfs, comparable to <code>/proc</code>, which is a procfs), which stores and allows modification of the devices connected to the system, whereas many traditional Unix-like operating systems use <code>/sys</code> as a symbolic link to the kernel source tree.
  • Many modern Unix-like systems (such as FreeBSD and OpenBSD) via their ports systems install third-party packages into <code>/usr/local</code>, while keeping code considered part of the operating system in <code>/usr</code>.
  • Some Linux distributions no longer differentiate between <code>/lib</code> and <code>/usr/lib</code> and have <code>/lib</code> symlinked to <code>/usr/lib</code>.
  • Some Linux distributions no longer differentiate between <code>/bin</code> and <code>/usr/bin</code> and between <code>/sbin</code> and <code>/usr/sbin</code>. They may symlink <code>/bin</code> to <code>/usr/bin</code> and <code>/sbin</code> to <code>/usr/sbin</code>. Other distributions choose to consolidate all four, symlinking them to <code>/usr/bin</code>.

Modern Linux distributions include a <code>/run</code> directory as a temporary filesystem (tmpfs), which stores volatile runtime data, following the FHS version 3.0. According to the FHS version 2.3, such data were stored in <code>/var/run</code>, but this was a problem in some cases because this directory is not always available at early boot. As a result, these programs have had to resort to workarounds, such as using <code>/dev/.udev</code>, <code>/dev/.mdadm</code>, <code>/dev/.systemd</code> or <code>/dev/.mount</code> directories, even though the device directory is not intended for such data. Among other advantages, this makes the system easier to use normally with the root filesystem mounted read-only.

For example, below are the changes Debian made in its 2013 Wheezy release:

  • <code>/dev/.*</code> → <code>/run/*</code>
  • <code>/dev/shm</code> → <code>/run/shm</code>
  • <code>/dev/shm/*</code> → <code>/run/*</code>
  • <code>/etc/*</code> (writeable files) → <code>/run/* </code>
  • <code>/lib/init/rw</code> → <code>/run</code>
  • <code>/var/lock</code> → <code>/run/lock</code>
  • <code>/var/run</code> → <code>/run</code>
  • <code>/tmp</code> → <code>/run/tmp</code>

History

FHS was created as the FSSTND (short for "Filesystem Standard"), largely based on similar standards for other Unix-like operating systems, such as the Version 7 Unix from 1979, the SunOS 4.x and its successor, the Solaris , and the FreeBSD .

Release history

{| class="wikitable"

|-

! Version

! Release date

! Notes

|-

|

| 1994-02-14

| FSSTND

|-

|

| 1994-10-09

| FSSTND

|-

|

| 1995-03-28

| FSSTND

|-

|

| 1997-10-26

| FHS 2.0 is the direct successor for FSSTND 1.2. Name of the standard was changed to Filesystem Hierarchy Standard.

|-

|

| 2000-04-12

| FHS

|-

|

| 2001-05-23

| FHS

|-

|

| 2004-01-29

| FHS

|-

|

| 2015-05-18

| FHS

|-

| colspan="3" | <small></small>

|}

See also

  • Hierarchical file system
  • Unix directory structure
  • XDG Base Directory Specification

Notes

References

  • FHS Mailing List
  • FHS repo
  • Official website (2015–2025, historical)
  • Original FHS website (archival)
  • systemd: file-hierarchy — File system hierarchy overview
  • UAPI Group Specifications: Linux File System Hierarchy
  • A proposal for a new filesystem hierarchy, based on object-oriented design principles.
  • Yet another very different hierarchy (used in cLIeNUX).