1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Modified Sun Jul 25 11:05:58 1993 by Rik Faith (faith@cs.unc.edu)
26 .\" Modified Sat Feb 10 16:18:03 1996 by Urs Thuermann (urs@isnogud.escape.de)
27 .\" Modified Mon Jun 16 20:02:00 1997 by Nicolás Lichtmaier <nick@debian.org>
28 .\" Modified Mon Feb 6 16:41:00 1999 by Nicolás Lichtmaier <nick@debian.org>
29 .\" Modified Tue Feb 8 16:46:45 2000 by Chris Pepper <pepper@tgg.com>
30 .\" Modified Fri Sep 7 20:32:45 2001 by Tammy Fox <tfox@redhat.com>
31 .TH HIER 7 2017-11-26 "Linux" "Linux Programmer's Manual"
33 hier \- description of the filesystem hierarchy
35 A typical Linux system has, among others, the following directories:
38 This is the root directory.
39 This is where the whole tree starts.
42 This directory contains executable programs which are needed in
43 single user mode and to bring the system up or repair it.
46 Contains static files for the boot loader.
47 This directory holds only
48 the files which are needed during the boot process.
50 and configuration files should go to
54 The operating system kernel (initrd for example) must be located in either
60 Special or device files, which refer to physical devices.
65 Contains configuration files which are local to the machine.
67 larger software packages, like X11, can have their own subdirectories
70 Site-wide configuration files may be placed here or in
72 Nevertheless, programs should always look for these files in
74 and you may have links for these files to
78 Host-specific configuration files for add-on applications installed
83 This directory contains the configuration files for SGML (optional).
86 When a new user account is created, files from this directory are
87 usually copied into the user's home directory.
90 Configuration files for the X11 window system (optional).
93 This directory contains the configuration files for XML (optional).
96 On machines with home directories for users, these are usually beneath
97 this directory, directly or not.
98 The structure of this directory
99 depends on local administration decisions (optional).
102 This directory should hold those shared libraries that are necessary
103 to boot the system and to run the commands in the root filesystem.
106 These directories are variants of
108 on system which support more than one binary format requiring separate
109 libraries (optional).
112 Loadable kernel modules (optional).
115 This directory contains items lost in the filesystem.
116 These items are usually chunks of files mangled as a consequence of
117 a faulty disk or a system crash.
120 This directory contains mount points for removable media such as CD
121 and DVD disks or USB sticks.
122 On systems where more than one device exists
123 for mounting a certain type of media,
124 mount directories can be created by appending a digit
125 to the name of those available above starting with '0',
126 but the unqualified name must also exist.
128 .I /media/floppy[1\-9]
129 Floppy drive (optional).
131 .I /media/cdrom[1\-9]
132 CD-ROM drive (optional).
134 .I /media/cdrecorder[1\-9]
135 CD writer (optional).
138 Zip drive (optional).
141 USB drive (optional).
144 This directory is a mount point for a temporarily mounted filesystem.
145 In some distributions,
147 contains subdirectories intended to be used as mount points for several
148 temporary filesystems.
151 This directory should contain add-on packages that contain static files.
154 This is a mount point for the
156 filesystem, which provides information about running processes and
158 This pseudo-filesystem is described in more detail in
162 This directory is usually the home directory for the root user (optional).
167 this directory holds commands needed to boot the system, but which are
168 usually not executed by normal users.
171 This directory contains site-specific data that is served by this system.
174 This is a mount point for the sysfs filesystem, which provides information
175 about the kernel like
177 but better structured, following the formalism of kobject infrastructure.
180 This directory contains temporary files which may be deleted with no
181 notice, such as by a regular job or at system boot up.
184 This directory is usually mounted from a separate partition.
185 It should hold only shareable, read-only data, so that it can be mounted
186 by various machines running Linux.
189 The X\-Window system, version 11 release 6 (optional).
192 Binaries which belong to the X\-Window system; often, there is a
193 symbolic link from the more traditional
198 Data files associated with the X\-Window system.
200 .I /usr/X11R6/lib/X11
201 These contain miscellaneous files needed to run X; Often, there is a
206 .I /usr/X11R6/include/X11
207 Contains include files needed for compiling programs using the X11
209 Often, there is a symbolic link from
214 This is the primary directory for executable programs.
216 executed by normal users which are not needed for booting or for
217 repairing the system and which are not installed locally should be
218 placed in this directory.
221 Commands for the MH mail handling system (optional).
224 is the traditional place to look for X11 executables; on Linux, it
225 usually is a symbolic link to
230 .IR /usr/share/dict .
237 Site-wide configuration files to be shared between several machines
238 may be stored in this directory.
239 However, commands should always
240 reference those files using the
245 should point to the appropriate files in
249 Binaries for games and educational programs (optional).
252 Include files for the C compiler.
255 BSD compatibility include files (optional).
258 Include files for the C compiler and the X\-Window system.
260 usually a symbolic link to
261 .IR /usr/X11R6/include/X11 .
264 Include files which declare some assembler functions.
267 .IR /usr/src/linux/include/asm .
269 .I /usr/include/linux
270 This contains information which may change from system release to
271 system release and used to be a symbolic link to
272 .I /usr/src/linux/include/linux
273 to get at operating-system-specific information.
275 (Note that one should have include files there that work correctly with
276 the current libc and in user space.
277 However, Linux kernel source is not
278 designed to be used with user programs and does not know anything
279 about the libc you are using.
280 It is very likely that things will break
284 .I /usr/include/linux
285 point at a random kernel tree.
286 Debian systems don't do this
287 and use headers from a known good kernel
288 version, provided in the libc*-dev package.)
291 Include files to use with the GNU C++ compiler.
294 Object libraries, including dynamic libraries, plus some executables
295 which usually are not invoked directly.
296 More complicated programs may
297 have whole subdirectories there.
300 These directories are variants of
302 on system which support more than one binary format requiring separate
303 libraries, except that the symbolic link
304 .I /usr/lib<qual>/X11
305 is not required (optional).
308 The usual place for data files associated with X programs, and
309 configuration files for the X system itself.
310 On Linux, it usually is
312 .IR /usr/X11R6/lib/X11 .
315 contains executables and include files for the GNU C compiler,
319 Files for the GNU groff document formatting system.
326 This is where programs which are local to the site typically go.
329 Binaries for programs local to the site.
335 Configuration files associated with locally installed programs.
338 Binaries for locally installed games.
341 Files associated with locally installed programs.
343 .I /usr/local/lib<qual>
344 These directories are variants of
346 on system which support more than one binary format requiring separate
347 libraries (optional).
349 .I /usr/local/include
350 Header files for the local C compiler.
353 Info pages associated with locally installed programs.
356 Man pages associated with locally installed programs.
359 Locally installed programs for system administration.
362 Local application data that can be shared among different architectures
366 Source code for locally installed software.
373 This directory contains program binaries for system administration
374 which are not essential for the boot process, for mounting
376 or for system repair.
379 This directory contains subdirectories with specific application data, that
380 can be shared among different architectures of the same OS.
381 Often one finds stuff here that used to live in
389 Contains the word lists used by spell checkers (optional).
391 .I /usr/share/dict/words
392 List of English words (optional).
395 Documentation about installed programs (optional).
398 Static data files for games in
403 Info pages go here (optional).
406 Locale information goes here (optional).
409 Manual pages go here in subdirectories according to the man page sections.
411 .I /usr/share/man/<locale>/man[1\-9]
412 These directories contain manual pages for the
413 specific locale in source code form.
414 Systems which use a unique language and code set for all manual pages
415 may omit the <locale> substring.
418 Miscellaneous data that can be shared among different architectures of the
422 The message catalogs for native language support go here (optional).
425 Files for SGML (optional).
427 .I /usr/share/sgml/docbook
428 DocBook DTD (optional).
430 .I /usr/share/sgml/tei
433 .I /usr/share/sgml/html
436 .I /usr/share/sgml/mathtml
437 MathML DTD (optional).
439 .I /usr/share/terminfo
440 The database for terminfo (optional).
443 Troff macros that are not distributed with groff (optional).
446 Files for XML (optional).
448 .I /usr/share/xml/docbook
449 DocBook DTD (optional).
451 .I /usr/share/xml/xhtml
452 XHTML DTD (optional).
454 .I /usr/share/xml/mathml
455 MathML DTD (optional).
457 .I /usr/share/zoneinfo
458 Files for timezone information (optional).
461 Source files for different parts of the system, included with some packages
462 for reference purposes.
463 Don't work here with your own projects, as files
464 below /usr should be read-only except when installing software (optional).
467 This was the traditional place for the kernel source.
468 Some distributions put here the source for the default kernel they ship.
469 You should probably use another directory when building your own kernel.
473 This should be a link
476 This link is present only for compatibility reasons and shouldn't be used.
479 This directory contains files which may change in size, such as spool
483 Process accounting logs (optional).
486 This directory is superseded by
488 and should be a symbolic link to
492 Reserved for historical reasons.
495 Data cached for programs.
498 Locally-generated fonts (optional).
501 Locally-formatted man pages (optional).
504 WWW proxy or cache data (optional).
506 .I /var/cache/<package>
507 Package specific cache data (optional).
509 .IR /var/catman/cat[1\-9] " or " /var/cache/man/cat[1\-9]
510 These directories contain preformatted manual pages according to their
512 (The use of preformatted manual pages is deprecated.)
515 System crash dumps (optional).
518 Reserved for historical reasons.
521 Variable game data (optional).
524 Variable state information for programs.
527 State directory for hwclock (optional).
530 Miscellaneous state data.
533 X display manager variable data (optional).
536 Editor backup files and state (optional).
539 These directories must be used for all distribution packaging support.
541 .I /var/lib/<package>
542 State data for packages and subsystems (optional).
544 .I /var/lib/<pkgtool>
545 Packaging support files (optional).
552 Lock files are placed in this directory.
553 The naming convention for
558 is the device's name in the filesystem.
559 The format used is that of HDU UUCP lock files, that is, lock files
560 contain a PID as a 10-byte ASCII decimal number, followed by a newline
564 Miscellaneous log files.
573 .IR /var/spool/mail .
576 Reserved for historical reasons.
579 Reserved for historical reasons.
582 Run-time variable files, like files holding process identifiers (PIDs)
583 and logged user information
585 Files in this directory are usually cleared when the system boots.
588 Spooled (or queued) files for various programs.
599 Spooled files for printing (optional).
601 .I /var/spool/lpd/printer
602 Spools for a specific printer (optional).
609 Queued outgoing mail (optional).
612 Spool directory for news (optional).
620 Spooled files for the
622 mail delivery program.
632 this directory holds temporary files stored for an unspecified duration.
635 Database files for NIS,
636 formerly known as the Sun Yellow Pages (YP).
638 The Filesystem Hierarchy Standard, Version 2.3
639 .UR http://www.pathname.com\:/fhs/
642 This list is not exhaustive; different systems may be configured
648 .BR file\-hierarchy (7),
651 The Filesystem Hierarchy Standard