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 /sbin and /etc. the operating system kernel (initrd for example) must be located in either / or /boot.
  • /dev โ€” special or device files, which refer to physical devices. see mknod(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 /lib on 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, /mnt contains 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 in proc(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/X11 to 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/X11 to 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/X11 to 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 /etc directory. links from files in /etc should 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/linux to 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/asm and /usr/include/linux point at a random kernel tree. Debian systems don't do this and use headers from a known good kernel version, provided in the libc*-dev package.) 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/lib on systems which support more than one binary format requiring separate libraries, except that the symbolic link /usr/libqual/X11 is 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 for uucp(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/lib on 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/doc or /usr/lib or /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 /usr are 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 is LCK..<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 for at(1).
  • /var/spool/cron โ€” spooled jobs for cron(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 for rwhod(8). (optional!)
  • /var/spool/smail โ€” spooled files for the smail(1) mail delivery program.
  • /var/spool/uucp โ€” spooled files for uucp(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
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms