Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Filesystem Hierarchy Standard
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Directory structure== [[File:Root directory hierarchy on Linux screenshot.webp|300px|thumb|Filesystem hierarchy in [[openSUSE]]]] In the FHS, all files and [[directory (file systems)|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 [[executable|binaries]] that need to be available in [[single-user mode]], including to bring up the system or repair it,<ref>{{Cite web|title=hier(7) - Linux manual page|url=https://man7.org/linux/man-pages/man7/hier.7.html|access-date=2021-01-06|website=man7.org}}</ref> for all users (e.g., [[cat (Unix)|cat]], [[ls]], [[cp (Unix)|cp]]). |- |<code>[[Boot folder|/boot]]</code> |[[Boot loader]] files (e.g., [[Kernel (operating system)|kernel]]s, [[initrd]]). |- |<code>[[/dev]]</code> |[[Device file]]s (e.g., <code>[[Null device|/dev/null]]</code>, <code>/dev/disk0</code>, <code>/dev/sda1</code>, <code>/dev/tty</code>, <code>[[%2Fdev%2Frandom]]</code>). |- |<code>/etc</code> <!-- Please see the talk page before changing this --> |Host-specific system-wide [[configuration file]]s.<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 ''[[et cetera|etcetera]] directory'',<ref>{{cite book |author=J. DeFelicc |title=Preliminary Release of UNIX Implementation Document |date=1972-03-17 |id=IMO.1-1 |section=E.0 |page=8 |issue=D |url=http://www.bitsavers.org/pdf/att/unix/Early_UNIX/PreliminaryUnixImplementationDocument_Jun72.pdf |access-date=6 June 2024}}</ref> 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).<ref name="/etc">{{cite web |url= http://www.pathname.com/fhs/pub/fhs-2.3.html#ETCHOSTSPECIFICSYSTEMCONFIGURATION |title=/etc : Host-specific system configuration |work=Filesystem Hierarchy Standard 2.3|access-date=18 February 2016}}</ref> Since the publication of early documentation, the directory name has been re-explained in various ways. Recent interpretations include [[backronym]]s such as "Editable Text Configuration" or "Extended Tool Chest".<ref>[http://ask.slashdot.org/article.pl?sid=07/03/03/028258 Define - /etc?], Posted by Cliff, 3 March 2007 - Slashdot.</ref> |- |<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 directory|home directories]], containing saved files, personal settings, etc. |- |<code>/lib</code> |[[Library (computer science)|Libraries]] essential for the [[binaries]] in <code>/bin</code> and <code>/sbin</code>. |- |<code>/lib<qual></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-ROM]]s (appeared in FHS-2.3 in 2004). |- |<code>/mnt</code> |Temporarily [[mount (computing)|mounted]] filesystems. |- |<code>/opt</code> |Add-on [[application software]] [[Software package (installation)|packages]].<ref name="/opt">{{cite web |url=http://www.pathname.com/fhs/pub/fhs-2.3.html#OPTADDONAPPLICATIONSOFTWAREPACKAGES |title=/opt : Add-on application software packages |work=Filesystem Hierarchy Standard 2.3 |access-date=18 February 2016}}</ref> |- |<code>[[/proc]]</code> |Virtual [[File system|filesystem]] providing [[process (computing)|process]] and [[kernel (operating system)|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 [[superuser|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 [[Daemon (computer software)|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 (command)|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.<ref name="/sys">{{cite web |url=https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch06.html#sysKernelAndSystemInformation |title=/sys : Kernel and system information virtual filesystem |work=Filesystem Hierarchy Standard 3.0 |access-date=4 June 2017}}</ref> |- |<code>/tmp</code> |[[Temporary folder|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|multi-]])user utilities and applications. Should be shareable and read-only.<ref>{{cite web|url=https://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#THEUSRHIERARCHY|work=Filesystem Hierarchy Standard 2.3|title=Chapter 4. The /usr Hierarchy}}</ref><ref>{{cite web|url=https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#purpose18|work=Filesystem Hierarchy Standard 3.0|title=Chapter 4. The /usr Hierarchy, Section 4.1 Purpose}}</ref> <!-- ##### /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 [[executable|binaries]] (not needed in [[single-user mode]]); for all users. |- |<code>/usr/include</code> |Standard [[header file|include files]]. |- |<code>/usr/lib</code> |[[Library (computer science)|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<qual></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>).<ref group="NB">Historically and strictly according to the standard, <code>/usr/local</code> is for data that must be stored on the local host (as opposed to <code>/usr</code>, which may be mounted across a network). Most of the time <code>/usr/local</code> is used for installing software/data that are ''not'' part of the standard operating system distribution (in such case, <code>/usr</code> would only contain software/data that ''are'' part of the standard operating system distribution). It is possible that the FHS standard may in the future be changed to reflect this de facto convention.</ref> |- |<code>/usr/sbin</code> |Non-essential system binaries (e.g., [[Daemon (computer software)|daemons]] for various [[network service]]s). |- |<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.<ref>{{cite web |url=https://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#VARRUNRUNTIMEVARIABLEDATA |title=/var/run : Run-time variable data |work=Filesystem Hierarchy Standard 2.3}}</ref><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 backwards compatibility.<ref>{{cite web |url=https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html |title=5.13. /var/run : Run-time variable data |work=Filesystem Hierarchy Standard 3.0}}</ref> |- |<code>/var/spool</code> |[[Spooling|Spool]] for tasks waiting to be processed (e.g., print queues and outgoing mail queue). |- |<code>/var/spool/mail</code> |[[Deprecated]] location for users' mailboxes.<ref>{{cite web |title=File System Standard |url=https://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.pdf |publisher=Linux Foundation |page=5.11.1}}</ref> |- |<code>/var/tmp</code> |Temporary files to be preserved between reboots. |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)