HIER
Section: Linux Programmer's Manual (7)
Updated: June 16, 1997
NAME
hier - Description of the file system hierarchy
DESCRIPTION
A typical Linux system has, among others, the following directories:
cLIeNUX NOTE
cLIeNUX does not adhere to this standard at all. The layout presented
here makes assumptions about the use of a system that are directly
contradictory to the purpose of cLIeNUX, which is to be, by default, for
single-user use of a GNU/Linux box. Furthermore, the historical names of
directories like "/bin" are incomprehensible to the new user, or have
become meaningless catch-alls, such as "/usr". By the way, in AT&T UNIX
circa 1971 "/usr" had the functionality of what is now "/home" in a
typical unix, and what is "/users" in cLIeNUX and some *BSDs. The
terseness of the historical names is less valuable in a scenario where
bandwidth between the user and the system is very high, and where csh/Bash
filename completion is available.
As my grasp of how to configure things with direct directory name
dependancies improves, cLIeNUX will be more removed from what is shown
here below this cLIeNUX addendum. This document is left in cLIeNUX as a
guide for imported packages, and as an illustration of some aspects of how
cLIeNUX is conceptually distinct from other unices.
The fundamental difference between a cLIeNUX file hierarchy and a
traditional unix hierarchy is that in cLIeNUX the user IS the admin,
and thus the root directory is an appropriate place for user-related
directories. This removes an entire layer of namespace overhead from many
things. If cLIeNUX is to be the basis for configuring a multi-user system,
one general rule of a hierarchical namespace is that adding things can
usually be done at will. Removing things is what is problematic, and, BTW,
I am somewhat proud of some of the ways in which cLIeNUX is "less". "less"
is harder than "more" in this context.
At this writing, most topic-named documentation in cLIeNUX is in the
"/help" directory. The cLIeNUX eqivalent of the manpages, the cLIeNUX
"seedocs", are in "/help/see". The traditional "/root" directory is
"/owner" in cLIeNUX, to remove the confusion of "/" being "the root
directory" when there's also a directory called "/root". Symlinks for
prefered names have been provided for things I'm not ready to actually
move yet. "/commands" is a symlink to "/bin", for example. Actually
renaming the "/bin" and "/dev" directories would require modifications to
the Linux kernel itself. (Rick)
(OK, back to our regularly scheduled legacy manpage...)
- /
-
This is the root directory. This is where the whole tree starts.
- /bin
-
This directory contains executable programs which are are needed in
single user mode and to bring the system up or repair it.
- /boot
-
Contains static files for the boot loader. This directory only holds
the files which are needed during the boot process. The map installer
and configuration files should go to
/sbin
and
/etc.
- /dev
-
Special or device files, which refer to physical devices. See
mknod(1).
- /dos
-
If both MS-DOS and Linux are run on one computer, this is a typical
place to mount a DOS file system.
- /etc
-
Contains 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/skel
-
When a new user account is created, files from this directory are
usually copied into the user's home directory.
- /etc/X11
-
Configuration files for the X11 window system.
- /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 admininstration decisions.
- /lib
-
This directory should hold those shared libraries that are necessary
to boot the system and to run the commands in the root filesystem.
- /mnt
-
is a mount point for temporarily mounted filesystems
- /proc
-
This is a mount point for the
proc
filesystem, which provides information about running processes and
the kernel. This pseudo-file system is described in more detail in
proc(5).
- /sbin
-
Like
/bin,
this directory holds commands needed to boot the system, but which are
usually not executed by normal users.
- /tmp
-
This directory contains temporary files which may be deleted with no
notice, such as by a regular job or at system boot up.
- /usr
-
This directory is usually mounted from a seperate partition. It
should hold only sharable, read-only data, so that it can be mounted
by various machines running Linux.
- /usr/X11R6
-
The X-Window system, version 11 release 6.
- /usr/X11R6/bin
-
Binaries which belong to the X-Windows 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-Windows 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 include files needed for compiling programs using the X11
window system. Often, there is a symbolic link from
/usr/inlcude/X11
to this directory.
- /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.
- /usr/bin/X11
-
is the traditional place to look for X11 executables; on Linux, it
usually is a symbolic link to
/usr/X11R6/bin.
- /usr/dict
-
This directory holds files containing word lists for spell checkers.
- /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/include
-
Include files for the C compiler.
- /usr/include/X11
-
Include files for the C compiler and the X-Windows 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,
but this isn't the case in Debian or libc6 based systems.
- /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.
Debian systems don't do this and use headers from a known good kernel
version, provided in the libc*-dev package.
- /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/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/lib/zoneinfo
-
Files for timezone information.
- /usr/local
-
This is where programs which are local to the site typically go in.
- /usr/local/bin
-
Binaries for programs local to the site go there.
- /usr/local/doc
-
Local documnetation
- /usr/local/etc
-
Configuration files associated with locally installed programs go there.
- /usr/local/lib
-
Files associated with locally installed programs go there.
- /usr/local/info
-
Info pages associated with locally installed programs go there.
- /usr/local/man
-
Manpages associated with locally installed programs go there.
- /usr/local/sbin
-
Locally installed programs for system admininstration.
- /usr/local/src
-
Source code for locally installed software.
- /usr/man
-
Manpages go in there, into their subdirectories.
- /usr/man/<locale>/man[1-9]
-
These directories contain manual pages which are in source code form.
Systems which use a unique language and code set for all manual pages
may omit the
<locale>
substring.
- /usr/sbin
-
This directories contains program binaries for system admininstration
which are not essentail for the boot process, for mounting
/usr,
or for system repair.
- /usr/src
-
Source files for different parts of the system.
- /usr/src/linux
-
This contains the sources for the kernel of the operating system itself.
- /usr/tmp
-
An alternative place to store temporary files; This should be a link
to
/var/tmp.
This link is present only for compatibility reasons and shouldn't be used.
- /var
-
This directory contains files which may change in size, such as spool
and log files.
- /var/adm
-
This directory is superseded by
/var/log
and should be a symbolic link to
/var/log.
- /var/backups
-
This directory is used to save backup copies of important system files.
- /var/catman/cat[1-9]
-
These directories contain preformatted manual pages according to their
manpage section.
- /var/lock
-
Lock files are plaed in this directory. The naming convention for
device lock files is
LCK..<device>
where
<device>
is the device's name in the filesystem.
The format used is that of HDU UUCP lock files, i.e. lock files
contain a PID as a 10-byte ASCII decimal number, followed by a newline
character.
- /var/log
-
Miscelanous log files.
- /var/preserve
-
This is where
vi(1)
saves edit sessions so they can be restored later.
- /var/run
-
Run-time varaible files, like files holding process identifiers (PIDs)
and logged user information
(utmp).
Files in this directory are usually cleared when the system boots.
- /var/spool
-
Spooled (or queued) files for various programs.
- /var/spool/at
-
Spooled jobs for
at(1).
- /var/spool/cron
-
Spooled jobs for
cron(1).
- /var/spool/lpd
-
Spooled files for printing.
- /var/spool/mail
-
User's mailboxes.
- /var/spool/smail
-
Spooled files for the
smail(1)
mail delivery program.
- /var/spool/news
-
Spool directory for the news subsystem.
- /var/spool/uucp
-
Spooled files for
uucp(1).
- /var/tmp
-
Like
/tmp,
this directory holds temporary files stored for an unspecified duration.
CONFORMS TO
The Linux filesystem standard, Release 1.2
BUGS
This list is not exhaustive; different systems may be configured
differently.
SEE ALSO
find(1),
ln(1),
mount(1),
proc(5),
The Linux Filesystem Standard