hier(7)
โจ NAME โจ
hier โ bestie, this is the full lore drop on the filesystem hierarchy ๐
like, literally every directory on a typical Linux system and what it's for. iykyk.
๐ฆ DESCRIPTION ๐ฆ
okay so picture this: a typical Linux system has, among others, the following directories. buckle up, we're going on a tour ๐
/โ the root directory, the blueprint, the main character ๐ this is where the whole tree starts./binโ executable programs that are needed in single user mode, and to bring the system up or repair it. so like, the emergency stash ๐/bootโ static files for the boot loader. it holds only the files that 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)for the deets ๐ง/etcโ 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/etc, and 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โ 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. it's like the starter pack for a new account ๐ผ/etc/X11โ configuration files for the X11 window system (optional)./etc/xmlโ 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). basically everyone's bedroom in the group house ๐/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>โ variants of/libon systems which support more than one binary format requiring separate libraries (optional)./lib/modulesโ loadable kernel modules (optional)./lost+foundโ items lost in the filesystem ๐ญ these items are usually chunks of files mangled as a consequence of a faulty disk or a system crash. the lost & found box nobody wants to dig through./mediaโ 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). yes, we're being inclusive to the retro icons ๐พ/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โ 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โ should contain add-on packages that contain static files./procโ 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โ usually the home directory for the root user (optional). yes, they get their own, no sharing with/homeโจ/runโ contains information which describes the system since it was booted. once this purpose was served by/var/run, and 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. admin-only zone ๐ง/srvโ contains site-specific data that is served by this system./sysโ a mount point for the sysfs filesystem, which provides information about the kernel like/proc, but better structured, following the formalism of kobject infrastructure. the glow-up version, no cap ๐/tmpโ temporary files which may be deleted with no notice, such as by a regular job or at system boot up. do not, i repeat, do not leave your important stuff here bestie ๐ญ/usrโ 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. so many machines, one vibe, sharing is caring ๐ซถ/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โ 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. the main stage ๐ฅ/usr/bin/mhโ commands for the MH mail handling system (optional)./usr/bin/X11โ 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). slay ๐ฎ/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.
โ ๏ธ okay so this is the important part, bestie, read it carefully: (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.) sobbing, do not do the random kernel tree thing ๐ญ
/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โ contains binaries for internal use only, and they are not meant to be executed directly by users' shell or scripts. background crew, no spotlight, still essential ๐/usr/lib<qual>โ variants of/usr/libon systems 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. the "not from the distro, i made this myself" zone ๐/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>โ variants of/usr/local/libon systems 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โ contains program binaries for system administration which are not essential for the boot process, for mounting/usr, or for system repair./usr/shareโ 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. it's giving "everything found its forever home" ๐/usr/share/colorโ contains color management information, like International Color Consortium (ICC) Color profiles (optional). literally the colorist of the filesystem, obsessed ๐ธ/usr/share/dictโ contains the word lists used by spell checkers (optional).
Ok so continuing the tour of the filesystem, bestie, we're deep in the /usr/share era and honestly it's iconic. Buckle up ๐
/usr/share/dict/wordsโ the list of English words. (optional!)/usr/share/docโ docs about the programs you actually installed. (optional!)/usr/share/gamesโ static data files for the games chilling in/usr/games. (optional!)/usr/share/infoโ info pages live here. (optional!)/usr/share/localeโ locale info lives here. (optional!)/usr/share/manโ manual pages!! yes bestie this is THEE directory, organized into subdirectories that follow the man page sections. ๐/usr/share/man/locale/man[1-9]โ these hold manual pages for that specific locale, in source code form. If a system uses one single language and code set for every manual page, it can just skip the<locale>substring entirely. lowkey efficient./usr/share/miscโ misc data that's shareable across different architectures of the same OS./usr/share/nlsโ message catalogs for native language support. (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!)/usr/share/tmacโ troff macros that don't ship 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 info. (optional!)/usr/srcโ source files for different parts of the system, bundled with some packages just for reference. ๐จ Do NOT work here on your own projects, okay? files under/usrare supposed to be read-only, except when you're installing software. (optional!)/usr/src/linuxโ the traditional spot for kernel source. Some distros drop the source for the default kernel they ship right here. But if you're building your own kernel, bestie, please go use another directory. ๐/usr/tmpโ obsolete. It's supposed to be a link to/var/tmp. The link only exists for compatibility reasons and you should not be using it. periodt./varโ files that can change in size live here, like spool and log files. it's giving main character energy, honestly./var/accountโ process accounting logs. (optional!)/var/admโ superseded by/var/log, and it 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]โ preformatted manual pages, sorted by their man page section. ๐ฉ heads up: using preformatted manual pages is deprecated./var/crashโ system crash dumps. (optional!)/var/cronโ reserved for historical reasons./var/gamesโ variable game data. (optional!)/var/libโ variable state information for programs./var/lib/colorโ variable files with 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. no exceptions, that's the rule./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 go in here. the naming convention for device lock files isLCK..<device>, where<device>is the device's name in the filesystem. the format used is the HDU UUCP lock file format, which means the lock files hold a PID as a 10-byte ASCII decimal number, followed by a newline character. iykyk ๐ฅ/var/logโ miscellaneous log files./var/optโ variable data for/opt./var/mailโ users' mailboxes. this one 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 here usually get cleared when the system boots./var/spoolโ spooled (aka 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 one 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โ just like/tmp, this one holds temporary files stored for an unspecified duration./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. slay, a whole standard. ๐
๐ BUGS ๐
This list is not exhaustive! different distributions and different systems may be configured differently. so like, vibe check your own machine, bestie. ๐ซถ
๐ SEE ALSO ๐
find(1), ln(1), proc(5), file-hierarchy(7), mount(8)
The Filesystem Hierarchy Standard
And that's a wrap on hier(7)!! ๐ go forth and know where your files live. this was brought to you by Linux man-pages 6.20, dated 2026-02-08, page hier(7) โ mwah, obsessed, bye bestie ๐โจ
๐ฆ where this page comes from
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- ๐ 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 on : a language model's rewrite of the original, under its terms