1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" Modified Sun Jul 25 11:05:58 1993 by Rik Faith (faith@cs.unc.edu)
6 .\" Modified Sat Feb 10 16:18:03 1996 by Urs Thuermann (urs@isnogud.escape.de)
7 .\" Modified Mon Jun 16 20:02:00 1997 by Nicolás Lichtmaier <nick@debian.org>
8 .\" Modified Mon Feb 6 16:41:00 1999 by Nicolás Lichtmaier <nick@debian.org>
9 .\" Modified Tue Feb 8 16:46:45 2000 by Chris Pepper <pepper@tgg.com>
10 .\" Modified Fri Sep 7 20:32:45 2001 by Tammy Fox <tfox@redhat.com>
11 .TH HIER 7 2021-03-22 "Linux" "Linux Programmer's Manual"
13 hier \- description of the filesystem hierarchy
15 A typical Linux system has, among others, the following directories:
18 This is the root directory.
19 This is where the whole tree starts.
22 This directory contains executable programs which are needed in
23 single user mode and to bring the system up or repair it.
26 Contains static files for the boot loader.
27 This directory holds only
28 the files which are needed during the boot process.
30 and configuration files should go to
34 The operating system kernel (initrd for example) must be located in either
40 Special or device files, which refer to physical devices.
45 Contains configuration files which are local to the machine.
47 larger software packages, like X11, can have their own subdirectories
50 Site-wide configuration files may be placed here or in
52 Nevertheless, programs should always look for these files in
54 and you may have links for these files to
58 Host-specific configuration files for add-on applications installed
63 This directory contains the configuration files for SGML (optional).
66 When a new user account is created, files from this directory are
67 usually copied into the user's home directory.
70 Configuration files for the X11 window system (optional).
73 This directory contains the configuration files for XML (optional).
76 On machines with home directories for users, these are usually beneath
77 this directory, directly or not.
78 The structure of this directory
79 depends on local administration decisions (optional).
82 This directory should hold those shared libraries that are necessary
83 to boot the system and to run the commands in the root filesystem.
86 These directories are variants of
88 on system which support more than one binary format requiring separate
92 Loadable kernel modules (optional).
95 This directory contains items lost in the filesystem.
96 These items are usually chunks of files mangled as a consequence of
97 a faulty disk or a system crash.
100 This directory contains mount points for removable media such as CD
101 and DVD disks or USB sticks.
102 On systems where more than one device exists
103 for mounting a certain type of media,
104 mount directories can be created by appending a digit
105 to the name of those available above starting with '0',
106 but the unqualified name must also exist.
108 .I /media/floppy[1\-9]
109 Floppy drive (optional).
111 .I /media/cdrom[1\-9]
112 CD-ROM drive (optional).
114 .I /media/cdrecorder[1\-9]
115 CD writer (optional).
118 Zip drive (optional).
121 USB drive (optional).
124 This directory is a mount point for a temporarily mounted filesystem.
125 In some distributions,
127 contains subdirectories intended to be used as mount points for several
128 temporary filesystems.
131 This directory should contain add-on packages that contain static files.
134 This is a mount point for the
136 filesystem, which provides information about running processes and
138 This pseudo-filesystem is described in more detail in
142 This directory is usually the home directory for the root user (optional).
145 This directory contains information which describes the system since it was booted.
146 Once this purpose was served by
148 and programs may continue to use it.
153 this directory holds commands needed to boot the system, but which are
154 usually not executed by normal users.
157 This directory contains site-specific data that is served by this system.
160 This is a mount point for the sysfs filesystem, which provides information
161 about the kernel like
163 but better structured, following the formalism of kobject infrastructure.
166 This directory contains temporary files which may be deleted with no
167 notice, such as by a regular job or at system boot up.
170 This directory is usually mounted from a separate partition.
171 It should hold only shareable, read-only data, so that it can be mounted
172 by various machines running Linux.
175 The X\-Window system, version 11 release 6 (present in FHS 2.3, removed
179 Binaries which belong to the X\-Window system; often, there is a
180 symbolic link from the more traditional
185 Data files associated with the X\-Window system.
187 .I /usr/X11R6/lib/X11
188 These contain miscellaneous files needed to run X; Often, there is a
193 .I /usr/X11R6/include/X11
194 Contains include files needed for compiling programs using the X11
196 Often, there is a symbolic link from
201 This is the primary directory for executable programs.
203 executed by normal users which are not needed for booting or for
204 repairing the system and which are not installed locally should be
205 placed in this directory.
208 Commands for the MH mail handling system (optional).
211 This is the traditional place to look for X11 executables; on Linux, it
212 usually is a symbolic link to
217 .IR /usr/share/dict .
224 Site-wide configuration files to be shared between several machines
225 may be stored in this directory.
226 However, commands should always
227 reference those files using the
232 should point to the appropriate files in
236 Binaries for games and educational programs (optional).
239 Include files for the C compiler.
242 BSD compatibility include files (optional).
245 Include files for the C compiler and the X\-Window system.
247 usually a symbolic link to
248 .IR /usr/X11R6/include/X11 .
251 Include files which declare some assembler functions.
254 .IR /usr/src/linux/include/asm .
256 .I /usr/include/linux
257 This contains information which may change from system release to
258 system release and used to be a symbolic link to
259 .I /usr/src/linux/include/linux
260 to get at operating-system-specific information.
262 (Note that one should have include files there that work correctly with
263 the current libc and in user space.
264 However, Linux kernel source is not
265 designed to be used with user programs and does not know anything
266 about the libc you are using.
267 It is very likely that things will break
271 .I /usr/include/linux
272 point at a random kernel tree.
273 Debian systems don't do this
274 and use headers from a known good kernel
275 version, provided in the libc*-dev package.)
278 Include files to use with the GNU C++ compiler.
281 Object libraries, including dynamic libraries, plus some executables
282 which usually are not invoked directly.
283 More complicated programs may
284 have whole subdirectories there.
287 Directory contains binaries for internal use only and they are not meant
288 to be executed directly by users shell or scripts.
291 These directories are variants of
293 on system which support more than one binary format requiring separate
294 libraries, except that the symbolic link
295 .I /usr/lib<qual>/X11
296 is not required (optional).
299 The usual place for data files associated with X programs, and
300 configuration files for the X system itself.
301 On Linux, it usually is
303 .IR /usr/X11R6/lib/X11 .
306 contains executables and include files for the GNU C compiler,
310 Files for the GNU groff document formatting system.
317 This is where programs which are local to the site typically go.
320 Binaries for programs local to the site.
326 Configuration files associated with locally installed programs.
329 Binaries for locally installed games.
332 Files associated with locally installed programs.
334 .I /usr/local/lib<qual>
335 These directories are variants of
337 on system which support more than one binary format requiring separate
338 libraries (optional).
340 .I /usr/local/include
341 Header files for the local C compiler.
344 Info pages associated with locally installed programs.
347 Man pages associated with locally installed programs.
350 Locally installed programs for system administration.
353 Local application data that can be shared among different architectures
357 Source code for locally installed software.
364 This directory contains program binaries for system administration
365 which are not essential for the boot process, for mounting
367 or for system repair.
370 This directory contains subdirectories with specific application data, that
371 can be shared among different architectures of the same OS.
372 Often one finds stuff here that used to live in
380 Contains color management information, like International Color Consortium (ICC)
381 Color profiles (optional).
384 Contains the word lists used by spell checkers (optional).
386 .I /usr/share/dict/words
387 List of English words (optional).
390 Documentation about installed programs (optional).
393 Static data files for games in
398 Info pages go here (optional).
401 Locale information goes here (optional).
404 Manual pages go here in subdirectories according to the man page sections.
406 .I /usr/share/man/<locale>/man[1\-9]
407 These directories contain manual pages for the
408 specific locale in source code form.
409 Systems which use a unique language and code set for all manual pages
410 may omit the <locale> substring.
413 Miscellaneous data that can be shared among different architectures of the
417 The message catalogs for native language support go here (optional).
420 Postscript Printer Definition (PPD) files (optional).
423 Files for SGML (optional).
425 .I /usr/share/sgml/docbook
426 DocBook DTD (optional).
428 .I /usr/share/sgml/tei
431 .I /usr/share/sgml/html
434 .I /usr/share/sgml/mathtml
435 MathML DTD (optional).
437 .I /usr/share/terminfo
438 The database for terminfo (optional).
441 Troff macros that are not distributed with groff (optional).
444 Files for XML (optional).
446 .I /usr/share/xml/docbook
447 DocBook DTD (optional).
449 .I /usr/share/xml/xhtml
450 XHTML DTD (optional).
452 .I /usr/share/xml/mathml
453 MathML DTD (optional).
455 .I /usr/share/zoneinfo
456 Files for timezone information (optional).
459 Source files for different parts of the system, included with some packages
460 for reference purposes.
461 Don't work here with your own projects, as files
462 below /usr should be read-only except when installing software (optional).
465 This was the traditional place for the kernel source.
466 Some distributions put here the source for the default kernel they ship.
467 You should probably use another directory when building your own kernel.
471 This should be a link
474 This link is present only for compatibility reasons and shouldn't be used.
477 This directory contains files which may change in size, such as spool
481 Process accounting logs (optional).
484 This directory is superseded by
486 and should be a symbolic link to
490 Reserved for historical reasons.
493 Data cached for programs.
496 Locally generated fonts (optional).
499 Locally formatted man pages (optional).
502 WWW proxy or cache data (optional).
504 .I /var/cache/<package>
505 Package specific cache data (optional).
507 .IR /var/catman/cat[1\-9] " or " /var/cache/man/cat[1\-9]
508 These directories contain preformatted manual pages according to their
510 (The use of preformatted manual pages is deprecated.)
513 System crash dumps (optional).
516 Reserved for historical reasons.
519 Variable game data (optional).
522 Variable state information for programs.
525 Variable files containing color management information (optional).
528 State directory for hwclock (optional).
531 Miscellaneous state data.
534 X display manager variable data (optional).
537 Editor backup files and state (optional).
540 These directories must be used for all distribution packaging support.
542 .I /var/lib/<package>
543 State data for packages and subsystems (optional).
545 .I /var/lib/<pkgtool>
546 Packaging support files (optional).
553 Lock files are placed in this directory.
554 The naming convention for
559 is the device's name in the filesystem.
560 The format used is that of HDU UUCP lock files, that is, lock files
561 contain a PID as a 10-byte ASCII decimal number, followed by a newline
565 Miscellaneous log files.
574 .IR /var/spool/mail .
577 Reserved for historical reasons.
580 Reserved for historical reasons.
583 Run-time variable files, like files holding process identifiers (PIDs)
584 and logged user information
586 Files in this directory are usually cleared when the system boots.
589 Spooled (or queued) files for various programs.
600 Spooled files for printing (optional).
602 .I /var/spool/lpd/printer
603 Spools for a specific printer (optional).
610 Queued outgoing mail (optional).
613 Spool directory for news (optional).
621 Spooled files for the
623 mail delivery program.
633 this directory holds temporary files stored for an unspecified duration.
636 Database files for NIS,
637 formerly known as the Sun Yellow Pages (YP).
639 The Filesystem Hierarchy Standard (FHS), Version 3.0, published March 19, 2015
640 .UR https://refspecs.linuxfoundation.org/fhs.shtml
643 This list is not exhaustive; different distributions and systems may be configured
649 .BR file\-hierarchy (7),
652 The Filesystem Hierarchy Standard