summaryrefslogtreecommitdiffstats
path: root/man7/hier.7
blob: 497e0f5fa7cce8a7ab46fc7a8329a40f1e2d2a25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
.\" Modified Sun Jul 25 11:05:58 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified Sat Feb 10 16:18:03 1996 by Urs Thuermann (urs@isnogud.escape.de)
.\" Modified Mon Jun 16 20:02:00 1997 by Nicolás Lichtmaier <nick@debian.org>
.\" Modified Mon Feb  6 16:41:00 1999 by Nicolás Lichtmaier <nick@debian.org>
.\" Modified Tue Feb  8 16:46:45 2000 by Chris Pepper <pepper@tgg.com>
.\" Modified Fri Sep  7 20:32:45 2001 by Tammy Fox <tfox@redhat.com>
.TH hier 7 2023-10-31 "Linux man-pages 6.7"
.SH NAME
hier \- description of the filesystem hierarchy
.SH DESCRIPTION
A typical Linux system has, among others, the following directories:
.TP
.I /
This is the root directory.
This is where the whole tree starts.
.TP
.I /bin
This directory contains executable programs which are needed in
single user mode and to bring the system up or repair it.
.TP
.I /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
.I /sbin
and
.IR /etc .
The operating system kernel (initrd for example) must be located in either
.I /
or
.IR /boot .
.TP
.I /dev
Special or device files, which refer to physical devices.
See
.BR mknod (1).
.TP
.I /etc
Contains configuration files which are local to the machine.
Some
larger software packages, like X11, can have their own subdirectories
below
.IR /etc .
Site-wide configuration files may be placed here or in
.IR /usr/etc .
Nevertheless, programs should always look for these files in
.I /etc
and you may have links for these files to
.IR /usr/etc .
.TP
.I /etc/opt
Host-specific configuration files for add-on applications installed
in
.IR /opt .
.TP
.I /etc/sgml
This directory contains the configuration files for SGML (optional).
.TP
.I /etc/skel
When a new user account is created, files from this directory are
usually copied into the user's home directory.
.TP
.I /etc/X11
Configuration files for the X11 window system (optional).
.TP
.I /etc/xml
This directory contains the configuration files for XML (optional).
.TP
.I /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).
.TP
.I /lib
This directory should hold those shared libraries that are necessary
to boot the system and to run the commands in the root filesystem.
.TP
.I /lib<qual>
These directories are variants of
.I /lib
on system which support more than one binary format requiring separate
libraries (optional).
.TP
.I /lib/modules
Loadable kernel modules (optional).
.TP
.I /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.
.TP
.I /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.
.TP
.I /media/floppy[1\-9]
Floppy drive (optional).
.TP
.I /media/cdrom[1\-9]
CD-ROM drive (optional).
.TP
.I /media/cdrecorder[1\-9]
CD writer (optional).
.TP
.I /media/zip[1\-9]
Zip drive (optional).
.TP
.I /media/usb[1\-9]
USB drive (optional).
.TP
.I /mnt
This directory is a mount point for a temporarily mounted filesystem.
In some distributions,
.I /mnt
contains subdirectories intended to be used as mount points for several
temporary filesystems.
.TP
.I /opt
This directory should contain add-on packages that contain static files.
.TP
.I /proc
This is a mount point for the
.I proc
filesystem, which provides information about running processes and
the kernel.
This pseudo-filesystem is described in more detail in
.BR proc (5).
.TP
.I /root
This directory is usually the home directory for the root user (optional).
.TP
.I /run
This directory contains information which
describes the system since it was booted.
Once this purpose was served by
.I /var/run
and programs may continue to use it.
.TP
.I /sbin
Like
.IR /bin ,
this directory holds commands needed to boot the system, but which are
usually not executed by normal users.
.TP
.I /srv
This directory contains site-specific data that is served by this system.
.TP
.I /sys
This is a mount point for the sysfs filesystem, which provides information
about the kernel like
.IR /proc ,
but better structured, following the formalism of kobject infrastructure.
.TP
.I /tmp
This directory contains temporary files which may be deleted with no
notice, such as by a regular job or at system boot up.
.TP
.I /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.
.TP
.I /usr/X11R6
The X\-Window system, version 11 release 6 (present in FHS 2.3, removed
in FHS 3.0).
.TP
.I /usr/X11R6/bin
Binaries which belong to the X\-Window system; often, there is a
symbolic link from the more traditional
.I /usr/bin/X11
to here.
.TP
.I /usr/X11R6/lib
Data files associated with the X\-Window system.
.TP
.I /usr/X11R6/lib/X11
These contain miscellaneous files needed to run X;  Often, there is a
symbolic link from
.I /usr/lib/X11
to this directory.
.TP
.I /usr/X11R6/include/X11
Contains include files needed for compiling programs using the X11
window system.
Often, there is a symbolic link from
.I /usr/include/X11
to this directory.
.TP
.I /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.
.TP
.I /usr/bin/mh
Commands for the MH mail handling system (optional).
.TP
.I /usr/bin/X11
This is the traditional place to look for X11 executables; on Linux, it
usually is a symbolic link to
.IR /usr/X11R6/bin .
.TP
.I /usr/dict
Replaced by
.IR /usr/share/dict .
.TP
.I /usr/doc
Replaced by
.IR /usr/share/doc .
.TP
.I /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
.I /etc
directory.
Links from files in
.I /etc
should point to the appropriate files in
.IR /usr/etc .
.TP
.I /usr/games
Binaries for games and educational programs (optional).
.TP
.I /usr/include
Include files for the C compiler.
.TP
.I /usr/include/bsd
BSD compatibility include files (optional).
.TP
.I /usr/include/X11
Include files for the C compiler and the X\-Window system.
This is
usually a symbolic link to
.IR /usr/X11R6/include/X11 .
.TP
.I /usr/include/asm
Include files which declare some assembler functions.
This used to be a
symbolic link to
.IR /usr/src/linux/include/asm .
.TP
.I /usr/include/linux
This contains information which may change from system release to
system release and used to be a symbolic link to
.I /usr/src/linux/include/linux
to get at operating-system-specific information.
.IP
(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
.I /usr/include/asm
and
.I /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.)
.TP
.I /usr/include/g++
Include files to use with the GNU C++ compiler.
.TP
.I /usr/lib
Object libraries, including dynamic libraries, plus some executables
which usually are not invoked directly.
More complicated programs may
have whole subdirectories there.
.TP
.I /usr/libexec
Directory contains binaries for internal use only and they are not meant
to be executed directly by users shell or scripts.
.TP
.I /usr/lib<qual>
These directories are variants of
.I /usr/lib
on system which support more than one binary format requiring separate
libraries, except that the symbolic link
.IR /usr/lib qual /X11
is not required (optional).
.TP
.I /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
.IR /usr/X11R6/lib/X11 .
.TP
.I /usr/lib/gcc\-lib
contains executables and include files for the GNU C compiler,
.BR gcc (1).
.TP
.I /usr/lib/groff
Files for the GNU groff document formatting system.
.TP
.I /usr/lib/uucp
Files for
.BR uucp (1).
.TP
.I /usr/local
This is where programs which are local to the site typically go.
.TP
.I /usr/local/bin
Binaries for programs local to the site.
.TP
.I /usr/local/doc
Local documentation.
.TP
.I /usr/local/etc
Configuration files associated with locally installed programs.
.TP
.I /usr/local/games
Binaries for locally installed games.
.TP
.I /usr/local/lib
Files associated with locally installed programs.
.TP
.I /usr/local/lib<qual>
These directories are variants of
.I /usr/local/lib
on system which support more than one binary format requiring separate
libraries (optional).
.TP
.I /usr/local/include
Header files for the local C compiler.
.TP
.I /usr/local/info
Info pages associated with locally installed programs.
.TP
.I /usr/local/man
Man pages associated with locally installed programs.
.TP
.I /usr/local/sbin
Locally installed programs for system administration.
.TP
.I /usr/local/share
Local application data that can be shared among different architectures
of the same OS.
.TP
.I /usr/local/src
Source code for locally installed software.
.TP
.I /usr/man
Replaced by
.IR /usr/share/man .
.TP
.I /usr/sbin
This directory contains program binaries for system administration
which are not essential for the boot process, for mounting
.IR /usr ,
or for system repair.
.TP
.I /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
.I /usr/doc
or
.I /usr/lib
or
.IR /usr/man .
.TP
.I /usr/share/color
Contains color management information, like International Color Consortium (ICC)
Color profiles (optional).
.TP
.I /usr/share/dict
Contains the word lists used by spell checkers (optional).
.TP
.I /usr/share/dict/words
List of English words (optional).
.TP
.I /usr/share/doc
Documentation about installed programs (optional).
.TP
.I /usr/share/games
Static data files for games in
.I /usr/games
(optional).
.TP
.I /usr/share/info
Info pages go here (optional).
.TP
.I /usr/share/locale
Locale information goes here (optional).
.TP
.I /usr/share/man
Manual pages go here in subdirectories according to the man page sections.
.TP
.IR /usr/share/man/ locale /man[1\-9]
These directories contain manual pages for the
specific locale in source code form.
Systems which use a unique language and code set for all manual pages
may omit the <locale> substring.
.TP
.I /usr/share/misc
Miscellaneous data that can be shared among different architectures of the
same OS.
.TP
.I /usr/share/nls
The message catalogs for native language support go here (optional).
.TP
.I /usr/share/ppd
Postscript Printer Definition (PPD) files (optional).
.TP
.I /usr/share/sgml
Files for SGML (optional).
.TP
.I /usr/share/sgml/docbook
DocBook DTD (optional).
.TP
.I /usr/share/sgml/tei
TEI DTD (optional).
.TP
.I /usr/share/sgml/html
HTML DTD (optional).
.TP
.I /usr/share/sgml/mathml
MathML DTD (optional).
.TP
.I /usr/share/terminfo
The database for terminfo (optional).
.TP
.I /usr/share/tmac
Troff macros that are not distributed with groff (optional).
.TP
.I /usr/share/xml
Files for XML (optional).
.TP
.I /usr/share/xml/docbook
DocBook DTD (optional).
.TP
.I /usr/share/xml/xhtml
XHTML DTD (optional).
.TP
.I /usr/share/xml/mathml
MathML DTD (optional).
.TP
.I /usr/share/zoneinfo
Files for timezone information (optional).
.TP
.I /usr/src
Source files for different parts of the system, included with some packages
for reference purposes.
Don't work here with your own projects, as files
below /usr should be read-only except when installing software (optional).
.TP
.I /usr/src/linux
This was the traditional place for the kernel source.
Some distributions put here the source for the default kernel they ship.
You should probably use another directory when building your own kernel.
.TP
.I /usr/tmp
Obsolete.
This should be a link
to
.IR /var/tmp .
This link is present only for compatibility reasons and shouldn't be used.
.TP
.I /var
This directory contains files which may change in size, such as spool
and log files.
.TP
.I /var/account
Process accounting logs (optional).
.TP
.I /var/adm
This directory is superseded by
.I /var/log
and should be a symbolic link to
.IR /var/log .
.TP
.I /var/backups
Reserved for historical reasons.
.TP
.I /var/cache
Data cached for programs.
.TP
.I /var/cache/fonts
Locally generated fonts (optional).
.TP
.I /var/cache/man
Locally formatted man pages (optional).
.TP
.I /var/cache/www
WWW proxy or cache data (optional).
.TP
.I /var/cache/<package>
Package specific cache data (optional).
.TP
.IR /var/catman/cat[1\-9] " or " /var/cache/man/cat[1\-9]
These directories contain preformatted manual pages according to their
man page section.
(The use of preformatted manual pages is deprecated.)
.TP
.I /var/crash
System crash dumps (optional).
.TP
.I /var/cron
Reserved for historical reasons.
.TP
.I /var/games
Variable game data (optional).
.TP
.I /var/lib
Variable state information for programs.
.TP
.I /var/lib/color
Variable files containing color management information (optional).
.TP
.I /var/lib/hwclock
State directory for hwclock (optional).
.TP
.I /var/lib/misc
Miscellaneous state data.
.TP
.I /var/lib/xdm
X display manager variable data (optional).
.TP
.I /var/lib/<editor>
Editor backup files and state (optional).
.TP
.I /var/lib/<name>
These directories must be used for all distribution packaging support.
.TP
.I /var/lib/<package>
State data for packages and subsystems (optional).
.TP
.I /var/lib/<pkgtool>
Packaging support files (optional).
.TP
.I /var/local
Variable data for
.IR /usr/local .
.TP
.I /var/lock
Lock files are placed in this directory.
The naming convention for
device lock files is
.I LCK..<device>
where
.I <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.
.TP
.I /var/log
Miscellaneous log files.
.TP
.I /var/opt
Variable data for
.IR /opt .
.TP
.I /var/mail
Users' mailboxes.
Replaces
.IR /var/spool/mail .
.TP
.I /var/msgs
Reserved for historical reasons.
.TP
.I /var/preserve
Reserved for historical reasons.
.TP
.I /var/run
Run-time variable files, like files holding process identifiers (PIDs)
and logged user information
.IR (utmp) .
Files in this directory are usually cleared when the system boots.
.TP
.I /var/spool
Spooled (or queued) files for various programs.
.TP
.I /var/spool/at
Spooled jobs for
.BR at (1).
.TP
.I /var/spool/cron
Spooled jobs for
.BR cron (8).
.TP
.I /var/spool/lpd
Spooled files for printing (optional).
.TP
.I /var/spool/lpd/printer
Spools for a specific printer (optional).
.TP
.I /var/spool/mail
Replaced by
.IR /var/mail .
.TP
.I /var/spool/mqueue
Queued outgoing mail (optional).
.TP
.I /var/spool/news
Spool directory for news (optional).
.TP
.I /var/spool/rwho
Spooled files for
.BR rwhod (8)
(optional).
.TP
.I /var/spool/smail
Spooled files for the
.BR smail (1)
mail delivery program.
.TP
.I /var/spool/uucp
Spooled files for
.BR uucp (1)
(optional).
.TP
.I /var/tmp
Like
.IR /tmp ,
this directory holds temporary files stored for an unspecified duration.
.TP
.I /var/yp
Database files for NIS,
formerly known as the Sun Yellow Pages (YP).
.SH STANDARDS
.UR https://refspecs.linuxfoundation.org/fhs.shtml
The Filesystem Hierarchy Standard (FHS), Version 3.0
.UE ,
published March 19, 2015
.SH BUGS
This list is not exhaustive;
different distributions and systems may be configured differently.
.SH SEE ALSO
.BR find (1),
.BR ln (1),
.BR proc (5),
.BR file\-hierarchy (7),
.BR mount (8)
.P
The Filesystem Hierarchy Standard