1HIER(7) Linux Programmer's Manual HIER(7)
2
3
4
6 hier - Description of the file system hierarchy
7
9 A typical Linux system has, among others, the following directories:
10
11 / This is the root directory. This is where the whole tree
12 starts.
13
14 /bin This directory contains executable programs which are needed in
15 single user mode and to bring the system up or repair it.
16
17 /boot Contains static files for the boot loader. This directory only
18 holds the files which are needed during the boot process. The
19 map installer and configuration files should go to /sbin and
20 /etc.
21
22 /dev Special or device files, which refer to physical devices. See
23 mknod(1).
24
25 /etc Contains configuration files which are local to the machine.
26 Some larger software packages, like X11, can have their own sub‐
27 directories below /etc. Site-wide configuration files may be
28 placed here or in /usr/etc. Nevertheless, programs should
29 always look for these files in /etc and you may have links for
30 these files to /usr/etc.
31
32 /etc/opt
33 Host-specific configuration files for add-on applications
34 installed in /opt.
35
36 /etc/sgml
37 This directory contains the configuration files for SGML and XML
38 (optional).
39
40 /etc/skel
41 When a new user account is created, files from this directory
42 are usually copied into the user's home directory.
43
44 /etc/X11
45 Configuration files for the X11 window system (optional).
46
47 /home On machines with home directories for users, these are usually
48 beneath this directory, directly or not. The structure of this
49 directory depends on local administration decisions.
50
51 /lib This directory should hold those shared libraries that are nec‐
52 essary to boot the system and to run the commands in the root
53 file system.
54
55 /media This directory contains mount points for removable media such as
56 CD and DVD disks or USB sticks.
57
58 /mnt This directory is a mount point for a temporarily mounted file
59 system. In some distributions, /mnt contains subdirectories
60 intended to be used as mount points for several temporary file
61 systems.
62
63 /opt This directory should contain add-on packages that contain
64 static files.
65
66 /proc This is a mount point for the proc file system, which provides
67 information about running processes and the kernel. This
68 pseudo-file system is described in more detail in proc(5).
69
70 /root This directory is usually the home directory for the root user
71 (optional).
72
73 /sbin Like /bin, this directory holds commands needed to boot the sys‐
74 tem, but which are usually not executed by normal users.
75
76 /srv This directory contains site-specific data that is served by
77 this system.
78
79 /tmp This directory contains temporary files which may be deleted
80 with no notice, such as by a regular job or at system boot up.
81
82 /usr This directory is usually mounted from a separate partition. It
83 should hold only sharable, read-only data, so that it can be
84 mounted by various machines running Linux.
85
86 /usr/X11R6
87 The X-Window system, version 11 release 6 (optional).
88
89 /usr/X11R6/bin
90 Binaries which belong to the X-Window system; often, there is a
91 symbolic link from the more traditional /usr/bin/X11 to here.
92
93 /usr/X11R6/lib
94 Data files associated with the X-Window system.
95
96 /usr/X11R6/lib/X11
97 These contain miscellaneous files needed to run X; Often, there
98 is a symbolic link from /usr/lib/X11 to this directory.
99
100 /usr/X11R6/include/X11
101 Contains include files needed for compiling programs using the
102 X11 window system. Often, there is a symbolic link from
103 /usr/include/X11 to this directory.
104
105 /usr/bin
106 This is the primary directory for executable programs. Most
107 programs executed by normal users which are not needed for boot‐
108 ing or for repairing the system and which are not installed
109 locally should be placed in this directory.
110
111 /usr/bin/X11
112 is the traditional place to look for X11 executables; on Linux,
113 it usually is a symbolic link to /usr/X11R6/bin.
114
115 /usr/dict
116 Replaced by /usr/share/dict.
117
118 /usr/doc
119 Replaced by /usr/share/doc.
120
121 /usr/etc
122 Site-wide configuration files to be shared between several
123 machines may be stored in this directory. However, commands
124 should always reference those files using the /etc directory.
125 Links from files in /etc should point to the appropriate files
126 in /usr/etc.
127
128 /usr/games
129 Binaries for games and educational programs (optional).
130
131 /usr/include
132 Include files for the C compiler.
133
134 /usr/include/X11
135 Include files for the C compiler and the X-Window system. This
136 is usually a symbolic link to /usr/X11R6/include/X11.
137
138 /usr/include/asm
139 Include files which declare some assembler functions. This used
140 to be a symbolic link to /usr/src/linux/include/asm.
141
142 /usr/include/linux
143 This contains information which may change from system release
144 to system release and used to be a symbolic link to
145 /usr/src/linux/include/linux to get at operating system specific
146 information.
147
148 (Note that one should have include files there that work cor‐
149 rectly with the current libc and in user space. However, Linux
150 kernel source is not designed to be used with user programs and
151 does not know anything about the libc you are using. It is very
152 likely that things will break if you let /usr/include/asm and
153 /usr/include/linux point at a random kernel tree. Debian sys‐
154 tems don't do this and use headers from a known good kernel ver‐
155 sion, provided in the libc*-dev package.)
156
157 /usr/include/g++
158 Include files to use with the GNU C++ compiler.
159
160 /usr/lib
161 Object libraries, including dynamic libraries, plus some exe‐
162 cutables which usually are not invoked directly. More compli‐
163 cated programs may have whole subdirectories there.
164
165 /usr/lib/X11
166 The usual place for data files associated with X programs, and
167 configuration files for the X system itself. On Linux, it usu‐
168 ally is a symbolic link to /usr/X11R6/lib/X11.
169
170 /usr/lib/gcc-lib
171 contains executables and include files for the GNU C compiler,
172 gcc(1).
173
174 /usr/lib/groff
175 Files for the GNU groff document formatting system.
176
177 /usr/lib/uucp
178 Files for uucp(1).
179
180 /usr/local
181 This is where programs which are local to the site typically go.
182
183 /usr/local/bin
184 Binaries for programs local to the site.
185
186 /usr/local/doc
187 Local documentation.
188
189 /usr/local/etc
190 Configuration files associated with locally installed programs.
191
192 /usr/local/games
193 Binaries for locally installed games.
194
195 /usr/local/lib
196 Files associated with locally installed programs.
197
198 /usr/local/include
199 Header files for the local C compiler.
200
201 /usr/local/info
202 Info pages associated with locally installed programs.
203
204 /usr/local/man
205 Man pages associated with locally installed programs.
206
207 /usr/local/sbin
208 Locally installed programs for system administration.
209
210 /usr/local/share
211 Local application data that can be shared among different archi‐
212 tectures of the same OS.
213
214 /usr/local/src
215 Source code for locally installed software.
216
217 /usr/man
218 Replaced by /usr/share/man.
219
220 /usr/sbin
221 This directory contains program binaries for system administra‐
222 tion which are not essential for the boot process, for mounting
223 /usr, or for system repair.
224
225 /usr/share
226 This directory contains subdirectories with specific application
227 data, that can be shared among different architectures of the
228 same OS. Often one finds stuff here that used to live in
229 /usr/doc or /usr/lib or /usr/man.
230
231 /usr/share/dict
232 Contains the word lists used by spell checkers.
233
234 /usr/share/doc
235 Documentation about installed programs.
236
237 /usr/share/games
238 Static data files for games in /usr/games.
239
240 /usr/share/info
241 Info pages go here.
242
243 /usr/share/locale
244 Locale information goes here.
245
246 /usr/share/man
247 Manual pages go here in subdirectories according to the man page
248 sections.
249
250 /usr/share/man/<locale>/man[1-9]
251 These directories contain manual pages for the specific locale
252 in source code form. Systems which use a unique language and
253 code set for all manual pages may omit the <locale> substring.
254
255 /usr/share/misc
256 Miscellaneous data that can be shared among different architec‐
257 tures of the same OS.
258
259 /usr/share/nls
260 The message catalogs for native language support go here.
261
262 /usr/share/sgml
263 Files for SGML and XML.
264
265 /usr/share/terminfo
266 The database for terminfo.
267
268 /usr/share/tmac
269 Troff macros that are not distributed with groff.
270
271 /usr/share/zoneinfo
272 Files for timezone information.
273
274 /usr/src
275 Source files for different parts of the system, included with
276 some packages for reference purposes. Don't work here with your
277 own projects, as files below /usr should be read-only except
278 when installing software.
279
280 /usr/src/linux
281 This was the traditional place for the kernel source. Some dis‐
282 tributions put here the source for the default kernel they ship.
283 You should probably use another directory when building your own
284 kernel.
285
286 /usr/tmp
287 Obsolete. This should be a link to /var/tmp. This link is
288 present only for compatibility reasons and shouldn't be used.
289
290 /var This directory contains files which may change in size, such as
291 spool and log files.
292
293 /var/adm
294 This directory is superseded by /var/log and should be a sym‐
295 bolic link to /var/log.
296
297 /var/backups
298 Reserved for historical reasons.
299
300 /var/cache
301 Data cached for programs.
302
303 /var/catman/cat[1-9] or /var/cache/man/cat[1-9]
304 These directories contain preformatted manual pages according to
305 their man page section. (The use of preformatted manual pages
306 is deprecated.)
307
308 /var/cron
309 Reserved for historical reasons.
310
311 /var/lib
312 Variable state information for programs.
313
314 /var/local
315 Variable data for /usr/local.
316
317 /var/lock
318 Lock files are placed in this directory. The naming convention
319 for device lock files is LCK..<device> where <device> is the
320 device's name in the file system. The format used is that of
321 HDU UUCP lock files, that is, lock files contain a PID as a
322 10-byte ASCII decimal number, followed by a newline character.
323
324 /var/log
325 Miscellaneous log files.
326
327 /var/opt
328 Variable data for /opt.
329
330 /var/mail
331 Users' mailboxes. Replaces /var/spool/mail.
332
333 /var/msgs
334 Reserved for historical reasons.
335
336 /var/preserve
337 Reserved for historical reasons.
338
339 /var/run
340 Run-time variable files, like files holding process identifiers
341 (PIDs) and logged user information (utmp). Files in this direc‐
342 tory are usually cleared when the system boots.
343
344 /var/spool
345 Spooled (or queued) files for various programs.
346
347 /var/spool/at
348 Spooled jobs for at(1).
349
350 /var/spool/cron
351 Spooled jobs for cron(8).
352
353 /var/spool/lpd
354 Spooled files for printing.
355
356 /var/spool/mail
357 Replaced by /var/mail.
358
359 /var/spool/mqueue
360 Queued outgoing mail.
361
362 /var/spool/news
363 Spool directory for news.
364
365 /var/spool/rwho
366 Spooled files for rwhod(8).
367
368 /var/spool/smail
369 Spooled files for the smail(1) mail delivery program.
370
371 /var/spool/uucp
372 Spooled files for uucp(1).
373
374 /var/tmp
375 Like /tmp, this directory holds temporary files stored for an
376 unspecified duration.
377
378 /var/yp
379 Database files for NIS.
380
382 The Filesystem Hierarchy Standard, Version 2.2 <http://www.path‐
383 name.com/fhs/>.
384
386 This list is not exhaustive; different systems may be configured dif‐
387 ferently.
388
390 find(1), ln(1), proc(5), mount(8)
391
392 The Filesystem Hierarchy Standard
393
395 This page is part of release 3.22 of the Linux man-pages project. A
396 description of the project, and information about reporting bugs, can
397 be found at http://www.kernel.org/doc/man-pages/.
398
399
400
401Linux 2009-03-30 HIER(7)