hier(7)
π NAME π
okay bestie, meet hier β description of the filesystem hierarchy. this is hier(7) from the Miscellaneous Information Manual, and it's literally the map of where everything on a Linux system is supposed to live. no cap.
πΊοΈ DESCRIPTION πΊοΈ
A typical Linux system has, among others, the following directories β and yes, we're going through all of them, because the details are the moment:
/β This is the root directory. This is where the whole tree starts. main character energy fr fr./binβ This directory contains executable programs which are needed in single user mode and to bring the system up or repair it./bootβ Contains static files for the boot loader. This directory holds only the files which are needed during the boot process. The map installer and configuration files should go to/sbinand/etc. The operating system kernel (initrdfor example) must be located in either/or/boot./devβ Special or device files, which refer to physical devices. Seemknod(1)./etcβ Contains configuration files which are local to the machine. Some larger software packages, like X11, can have their own subdirectories below/etc. Site-wide configuration files may be placed here or in/usr/etc. Nevertheless, programs should always look for these files in/etcand you may have links for these files to/usr/etc./etc/optβ Host-specific configuration files for add-on applications installed in/opt./etc/sgmlβ This directory contains the configuration files for SGML (optional)./etc/skelβ When a new user account is created, files from this directory are usually copied into the user's home directory./etc/X11β Configuration files for the X11 window system (optional)./etc/xmlβ This directory contains the configuration files for XML (optional)./homeβ On machines with home directories for users, these are usually beneath this directory, directly or not. The structure of this directory depends on local administration decisions (optional)./libβ This directory should hold those shared libraries that are necessary to boot the system and to run the commands in the root filesystem./lib<qual>β These directories are variants of/libon system which support more than one binary format requiring separate libraries (optional)./lib/modulesβ Loadable kernel modules (optional)./lost+foundβ This directory contains items lost in the filesystem. These items are usually chunks of files mangled as a consequence of a faulty disk or a system crash./mediaβ This directory contains mount points for removable media, such as CD and DVD disks or USB sticks. On systems where more than one device exists for mounting a certain type of media, mount directories can be created by appending a digit to the name of those available above starting with'0', but the unqualified name must also exist./media/floppy[1-9]β Floppy drive (optional)./media/cdrom[1-9]β CD-ROM drive (optional)./media/cdrecorder[1-9]β CD writer (optional)./media/zip[1-9]β Zip drive (optional)./media/usb[1-9]β USB drive (optional)./mntβ This directory is a mount point for a temporarily mounted filesystem. In some distributions,/mntcontains subdirectories intended to be used as mount points for several temporary filesystems./optβ This directory should contain add-on packages that contain static files./procβ This is a mount point for the proc filesystem, which provides information about running processes and the kernel. This pseudo-filesystem is described in more detail inproc(5)./rootβ This directory is usually the home directory for the root user (optional)./runβ This directory contains information which describes the system since it was booted. Once this purpose was served by/var/runand programs may continue to use it./sbinβ Like/bin, this directory holds commands needed to boot the system, but which are usually not executed by normal users./srvβ This directory contains site-specific data that is served by this system./sysβ This is a mount point for the sysfs filesystem, which provides information about the kernel like/proc, but better structured, following the formalism of kobject infrastructure./tmpβ This directory contains temporary files which may be deleted with no notice, such as by a regular job or at system boot up./usrβ This directory is usually mounted from a separate partition. It should hold only shareable, read-only data, so that it can be mounted by various machines running Linux./usr/X11R6β The X-Window system, version 11 release 6 (present in FHS 2.3, removed in FHS 3.0)./usr/X11R6/binβ Binaries which belong to the X-Window system; often, there is a symbolic link from the more traditional/usr/bin/X11to here./usr/X11R6/libβ Data files associated with the X-Window system./usr/X11R6/lib/X11β These contain miscellaneous files needed to run X. Often, there is a symbolic link from/usr/lib/X11to this directory./usr/X11R6/include/X11β Contains header files needed for compiling programs using the X11 window system. Often, there is a symbolic link from/usr/include/X11to this directory./usr/binβ This is the primary directory for executable programs. Most programs executed by normal users which are not needed for booting or for repairing the system and which are not installed locally should be placed in this directory./usr/bin/mhβ Commands for the MH mail handling system (optional)./usr/bin/X11β This is the traditional place to look for X11 executables; on Linux, it usually is a symbolic link to/usr/X11R6/bin./usr/dictβ Replaced by/usr/share/dict./usr/docβ Replaced by/usr/share/doc./usr/etcβ Site-wide configuration files to be shared between several machines may be stored in this directory. However, commands should always reference those files using the/etcdirectory. Links from files in/etcshould point to the appropriate files in/usr/etc./usr/gamesβ Binaries for games and educational programs (optional)./usr/includeβ Include files for the C compiler./usr/include/bsdβ BSD compatibility include files (optional)./usr/include/X11β Include files for the C compiler and the X-Window system. This is usually a symbolic link to/usr/X11R6/include/X11./usr/include/asmβ Include files which declare some assembler functions. This used to be a symbolic link to/usr/src/linux/include/asm./usr/include/linuxβ This contains information which may change from system release to system release and used to be a symbolic link to/usr/src/linux/include/linuxto get at operating-system-specific information.
(Note that one should have include files there that work correctly with the current libc and in user space. However, Linux kernel source is not designed to be used with user programs and does not know anything about the libc you are using. It is very likely that things will break if you let/usr/include/asmand/usr/include/linuxpoint at a random kernel tree. Debian systems don't do this and use headers from a known good kernel version, provided in thelibc*-devpackage.)
/usr/include/g++β Include files to use with the GNU C++ compiler./usr/libβ Object libraries, including dynamic libraries, plus some executables which usually are not invoked directly. More complicated programs may have whole subdirectories there./usr/libexecβ Directory contains binaries for internal use only and they are not meant to be executed directly by users shell or scripts./usr/lib<qual>β These directories are variants of/usr/libon system which support more than one binary format requiring separate libraries, except that the symbolic link/usr/libqual/X11is not required (optional)./usr/lib/X11β The usual place for data files associated with X programs, and configuration files for the X system itself. On Linux, it usually is a symbolic link to/usr/X11R6/lib/X11./usr/lib/gcc-libβ contains executables and include files for the GNU C compiler,gcc(1)./usr/lib/groffβ Files for the GNU groff document formatting system./usr/lib/uucpβ Files foruucp(1)./usr/localβ This is where programs which are local to the site typically go./usr/local/binβ Binaries for programs local to the site./usr/local/docβ Local documentation./usr/local/etcβ Configuration files associated with locally installed programs./usr/local/gamesβ Binaries for locally installed games./usr/local/libβ Files associated with locally installed programs./usr/local/lib<qual>β These directories are variants of/usr/local/libon system which support more than one binary format requiring separate libraries (optional)./usr/local/includeβ Header files for the local C compiler./usr/local/infoβ Info pages associated with locally installed programs./usr/local/manβ Man pages associated with locally installed programs./usr/local/sbinβ Locally installed programs for system administration./usr/local/shareβ Local application data that can be shared among different architectures of the same OS./usr/local/srcβ Source code for locally installed software./usr/manβ Replaced by/usr/share/man./usr/sbinβ This directory contains program binaries for system administration which are not essential for the boot process, for mounting/usr, or for system repair./usr/shareβ This directory contains subdirectories with specific application data, that can be shared among different architectures of the same OS. Often one finds stuff here that used to live in/usr/docor/usr/libor/usr/man./usr/share/colorβ Contains color management information, like International Color Consortium (ICC) Color profiles (optional)./usr/share/dictβ Contains the word lists used by spell checkers (optional)./usr/share/dict/wordsβ the list of English words lives here (optional, bestie, some systems just don't ship it π )./usr/share/docβ docs about the programs you've installed (optional)./usr/share/gamesβ static data files for the games chillin' in/usr/games(optional)./usr/share/infoβ info pages go here (optional)./usr/share/localeβ locale info goes here (optional)./usr/share/manβ manual pages!! yes this is where the manpages themselves live, in subdirectories sorted by man page section π./usr/share/man/locale/man[1-9]β these dirs hold manual pages for the specific locale, in source code form. Systems that use one single language and code set for all their manual pages are allowed to just omit the<locale>substring entirely β¨./usr/share/miscβ miscellaneous data that can be shared among different architectures of the same OS. sharing is caring fr fr./usr/share/nlsβ the message catalogs for native language support go here (optional)./usr/share/ppdβ Postscript Printer Definition (PPD) files (optional)./usr/share/sgmlβ files for SGML (optional)./usr/share/sgml/docbookβ DocBook DTD (optional)./usr/share/sgml/teiβ TEI DTD (optional)./usr/share/sgml/htmlβ HTML DTD (optional)./usr/share/sgml/mathmlβ MathML DTD (optional)./usr/share/terminfoβ the database for terminfo (optional). it's giving "terminal aesthetic" and we're obsessed./usr/share/tmacβ Troff macros that are not distributed with groff (optional)./usr/share/xmlβ files for XML (optional)./usr/share/xml/docbookβ DocBook DTD (optional)./usr/share/xml/xhtmlβ XHTML DTD (optional)./usr/share/xml/mathmlβ MathML DTD (optional)./usr/share/zoneinfoβ files for timezone information (optional). yes bestie, that zoneinfo π./usr/srcβ source files for different parts of the system, included with some packages for reference purposes. do not work here with your own projects, okay?? files below/usrshould be read-only except when you're installing software (optional). like, respect the boundary π«Ά./usr/src/linuxβ this was the traditional place for the kernel source. some distributions put the source for the default kernel they ship right here. you should probably use another directory when building your own kernel, ngl./usr/tmpβ obsolete π. this should be a link to/var/tmp. the link is present only for compatibility reasons and shouldn't be used./varβ this directory contains files which may change in size, like spool and log files. it's the "variable" girlie of the filesystem, main character energy./var/accountβ process accounting logs (optional)./var/admβ this directory is superseded by/var/logand should be a symbolic link to/var/log./var/backupsβ reserved for historical reasons./var/cacheβ data cached for programs./var/cache/fontsβ locally generated fonts (optional)./var/cache/manβ locally formatted man pages (optional)./var/cache/wwwβ WWW proxy or cache data (optional)./var/cache/<package>β package specific cache data (optional)./var/catman/cat[1-9]or/var/cache/man/cat[1-9]β these directories contain preformatted manual pages, sorted by their man page section. heads up though: the use of preformatted manual pages is deprecated β οΈ./var/crashβ system crash dumps (optional). sending thoughts and prayers to your uptime π./var/cronβ reserved for historical reasons./var/gamesβ variable game data (optional)./var/libβ variable state information for programs./var/lib/colorβ variable files containing color management information (optional)./var/lib/hwclockβ state directory for hwclock (optional)./var/lib/miscβ miscellaneous state data./var/lib/xdmβ X display manager variable data (optional)./var/lib/<editor>β editor backup files and state (optional)./var/lib/<name>β these directories must be used for all distribution packaging support. that's a must, not a maybe π ./var/lib/<package>β state data for packages and subsystems (optional)./var/lib/<pkgtool>β packaging support files (optional)./var/localβ variable data for/usr/local./var/lockβ lock files are placed in this directory. the naming convention for device lock files isLCK..<device>where<device>is the device's name in the filesystem. the format used is that of HDU UUCP lock files β that is, lock files contain a PID as a 10-byte ASCII decimal number, followed by a newline character. very specific, very iconic β¨./var/logβ miscellaneous log files. your receipts, essentially π./var/optβ variable data for/opt./var/mailβ users' mailboxes. replaces/var/spool/mailπ/var/msgsβ reserved for historical reasons./var/preserveβ reserved for historical reasons./var/runβ run-time variable files, like files holding process identifiers (PIDs) and logged user information (utmp). files in this directory are usually cleared when the system boots. so don't get attached π./var/spoolβ spooled (or queued) files for various programs./var/spool/atβ spooled jobs forat(1)./var/spool/cronβ spooled jobs forcron(8)./var/spool/lpdβ spooled files for printing (optional)./var/spool/lpd/printerβ spools for a specific printer (optional)./var/spool/mailβ replaced by/var/mail./var/spool/mqueueβ queued outgoing mail (optional)./var/spool/newsβ spool directory for news (optional)./var/spool/rwhoβ spooled files forrwhod(8)(optional)./var/spool/smailβ spooled files for thesmail(1)mail delivery program./var/spool/uucpβ spooled files foruucp(1)(optional)./var/tmpβ like/tmp, this directory holds temporary files stored for an unspecified duration. the "no thoughts just vibes" of temp storage./var/ypβ database files for NIS, formerly known as the Sun Yellow Pages (YP).
π STANDARDS β¨
The Filesystem Hierarchy Standard (FHS), Version 3.0, published March 19, 2015.
π BUGS π
This list is not exhaustive β different distributions and systems may be configured differently. so if your filesystem is doing something unhinged, it might just be a distro thing, no cap.
π SEE ALSO π
find(1), ln(1), proc(5), file-hierarchy(7), mount(8)
The Filesystem Hierarchy Standard
okay that's the whole tour bestie, go forth and know your filesystem π this lil' page came from Linux man-pages 6.18, dated 2026-02-08 β slay, and stay organized ππ¦
π¦ where this page comes from
- alpine 3.24: man-pages 6.18-r0 Β· GPL-2.0-or-later
- π the page's license: Linux-man-pages-copyleft
- Copyright 1993, Thomas Koenig <ig25@rz.uni-karlsruhe.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms