Filesystem Hierarchy Standard

The Filesystem Hierarchy Standard (FHS) defines the main directories and their contents in GNU/Linux and other Unix-like computer operating systems.

Overview

The process of developing a standard FileSystem hierarchy began in August 1993 with an effort to restructure the file and directory structure of GNU/Linux. The FSSTND (Filesystem Standard), a filesystem hierarchy standard specific to the GNU/Linux operating system, was released on February 14, 1994. Subsequent revisions were released on October 9, 1994 and March 28, 1995.

In early 1996, the goal of developing a more comprehensive version of FSSTND to address not only GNU/Linux, but other Unix-like 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 or FHS for short.

The FHS is maintained by the Free Standards Group, a non-profit organization consisting of major software and hardware vendors, such as HP, IBM and Dell. Still, the vast majority of the GNU/Linux distributions, including those developed by members of the Free Standards Group, do not follow this proposed standard. In particular, paths specifically created by the FHS editors, such as /media/ and /srv/, do not see widespread usage. Some Unix and GNU/Linux systems break with the FHS in favour of a different approach, as in Gobo GNU/Linux.

Directory structure

All files and directories appear under the root_directory “/”, even if stored on different physical devices.

A description of the hierarchy specified in the FHS:

Directory Description
/bin Essential user command binaries.
/boot Static files of the boot loader
/dev Device files
/etc Host-specific system configuration
/etc/local Host-specific system configuration for Local binaries
/etc/opt Host-specific system configuration for Add-on application software packages
/home User home directories
/kern Kernel and system information virtual filesystem (HyperBK kernel only; mounted with kernfs)
/lib Essential shared libraries
/lib/modules Loadable kernel modules (monolitic kernel package only)
/lib32 Essential shared libraries for 32bit binaries (multilib packages only)
/media Mount point for removable media
/mnt Mount point for temporarily mounted filesystem / Mount point for mounting a filesystem temporary
/opt Add-on application software packages
/proc Kernel and process information virtual filesystem (mounted with procfs)
/root Home directory for the root user
/run Run-time variable data / Data relevant to running processes
/sbin Essential system command binaries
/srv Data for services provided by this system
/sys Kernel and system information virtual filesystem (Linux* kernel only; mounted with sysfs)
/tmp Temporary files (mounted with tmpfs)
/usr Secondary hierarchy
/usr/bin Most user command binaries
/usr/games Games and educational binaries
/usr/include Directory for standard include files / Header files included by program languages
/usr/lib Shared libraries
/usr/lib/games Shared libraries for game binaries
/usr/lib32 Shared libraries for 32bit binaries (multilib packages only)
/usr/lib32/games Shared libraries for 32bit game binaries (multilib packages only)
/usr/libexec Binaries run by other programs
/usr/local Local hierarchy (for personal installation only)
/usr/local/bin Local user binaries
/usr/local/games Local games and educational binaries
/usr/local/include Local directory for standard include files / Local header files included by program languages
/usr/local/lib Local shared libraries
/usr/local/lib/games Local shared libraries for game binaries
/usr/local/lib32 Local shared libraries for 32bit binaries (multilib packages only)
/usr/local/lib32/games Local shared libraries for 32bit game binaries (multilib packages only)
/usr/local/libexec Local binaries run by other programs
/usr/local/sbin Local system binaries
/usr/local/share Local architecture-independent data
/usr/local/share/doc Local miscellaneous documentation (documentation packages only)
/usr/local/share/games Local static data files for game binaries
/usr/local/share/info Local primary directory for GNU Info system (texinfo package only)
/usr/local/share/man Local online manuals / Local manual pages
/usr/local/share/misc Local miscellaneous architecture-independent data
/usr/local/src Local source code (source code packages only)
/usr/sbin Non-vital system command binaries
/usr/share Architecture-independent data
/usr/share/doc Miscellaneous documentation (documentation packages only)
/usr/share/games Static data files for game binaries
/usr/share/info Primary directory for GNU Info system (texinfo package only)
/usr/share/man Online manuals / Manual pages
/usr/share/misc Miscellaneous architecture-independent data
/usr/src Source code (source code packages only)
/var Variable data
/var/cache Application cache data
/var/crash Kernel crash dumps (Linux* kernels not supported)
/var/games Variable game data
/var/lib Variable state information
/var/lib/misc Miscellaneous state data
/var/local Variable data for Local binaries
/var/lock Lock files
/var/log Log files
/var/mail User mailbox files
/var/opt Variable data for Add-on application software packages
/var/spool Application spool data
/var/tmp Temporary files preserved between system reboots

Acknowledgement

This wiki article is based on DebianWiki. We may have removed non-FSDG bits from it.