The Filesystem Hierarchy Standard (FHS) is a reference describing the conventions used for the layout of
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
systems. It has been made popular by its use in
Linux distribution
A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel functionality. Although the name does not imply product distribution per se, a distro—if distributed on its own—is oft ...
s, but it is used by other Unix-like systems as well. It is maintained by the
Linux Foundation
The Linux Foundation (LF) is a non-profit organization established in 2000 to support Linux development and open-source software projects.
Background
The Linux Foundation started as Open Source Development Labs in 2000 to standardize and prom ...
. The latest version is 3.0, released on 3 June 2015.
Directory structure

In the FHS, all files and
directories appear under the
root directory
In a Computing, computer file system, and primarily used in the Unix and Unix-like operating systems, the root directory is the first or top-most Directory (computing), directory in a hierarchy. It can be likened to the trunk of a Tree (data st ...
/
, 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
The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems.
X originated as part of Project Athena at Massachusetts Institute of Technology (MIT) in 1984. The X protocol has been at ...
, are installed.
Most of these directories exist in all
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
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.
FHS compliance
Most
Linux distribution
A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel functionality. Although the name does not imply product distribution per se, a distro—if distributed on its own—is oft ...
s 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
/sys
directory as a
virtual filesystem (
sysfs, comparable to
/proc
, which is a
procfs), which stores and allows modification of the devices connected to the system, whereas many traditional
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating systems use
/sys
as a
symbolic link
In computing, a symbolic link (also symlink or soft link) is a file whose purpose is to point to a file or directory (called the "target") by specifying a path thereto.
Symbolic links are supported by POSIX and by most Unix-like operating syste ...
to the
kernel source tree.
* Many modern Unix-like systems (such as
FreeBSD
FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
and
OpenBSD) via their
ports systems install third-party packages into
/usr/local
, while keeping code considered part of the operating system in
/usr
.
* Some Linux distributions no longer differentiate between
/lib
and
/usr/lib
and have
/lib
symlinked to
/usr/lib
.
* Some Linux distributions no longer differentiate between
/bin
and
/usr/bin
and between
/sbin
and
/usr/sbin
. They may symlink
/bin
to
/usr/bin
and
/sbin
to
/usr/sbin
. Other distributions choose to consolidate all four, symlinking them to
/usr/bin
.
Modern Linux distributions include a
/run
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
/var/run
, 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 trickery, such as using
/dev/.udev
,
/dev/.mdadm
,
/dev/.systemd
or
/dev/.mount
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
Debian () is a free and open-source software, free and open source Linux distribution, developed by the Debian Project, which was established by Ian Murdock in August 1993. Debian is one of the oldest operating systems based on the Linux kerne ...
made in its 2013 Wheezy release:
*
/dev/.*
→
/run/*
*
/dev/shm
→
/run/shm
*
/dev/shm/*
→
/run/*
*
/etc/*
(writeable files) →
/run/*
*
/lib/init/rw
→
/run
*
/var/lock
→
/run/lock
*
/var/run
→
/run
*
/tmp
→
/run/tmp
History
The name of usr
/usr
originally stood for "user". This was an artifact of early Unix programming. Specifically, when
Ken Thompson
Kenneth Lane Thompson (born February 4, 1943) is an American pioneer of computer science. Thompson worked at Bell Labs for most of his career where he designed and implemented the original Unix operating system. He also invented the B (programmi ...
and
Dennis Ritchie were migrating Unix to a PDP-11, the contents of the
/bin
and
/lib
directories, which were to be the first directories mounted on startup and to contain all essentials for the OS to function, became too large to fit on an
RK05 disk drive. So they put some of those files on a second RK05, making sure that the first drive contained everything required for loading the second one. The rest of the files were put into the
/usr
directory. When they got a third drive, users' files were moved to a new directory named
/home
.
FHS was created as the FSSTND (short for "Filesystem Standard"), largely based on similar standards for other
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating systems. Notable examples are these: the description of file system layout, which has existed since the release of
Version 7 Unix
Version 7 Unix, also called Seventh Edition 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 commerc ...
(in 1979); the
SunOS
SunOS is a Unix-branded operating system developed by Sun Microsystems for their workstation and server computer systems from 1982 until the mid-1990s. The ''SunOS'' name is usually only used to refer to versions 1.0 to 4.1.4, which were based ...
and its successor, the
Solaris .
Release history
See also
*
Hierarchical file system
*
Unix directory structure
*
XDG Base Directory Specification
Notes
References
External links
*
*
Full specification texts* A proposal for a new filesystem hierarchy, based on object-oriented design principles.
* Yet another very different hierarchy (used in cLIeNUX).
*
{{Linux
Computer standards
Linux
System administration
Unix file system technology