Академический Документы
Профессиональный Документы
Культура Документы
Linux Foundation
Initial release
Latest release
2.3
(29 January 2004; 10 years ago)
Website
Official website
Official website (Historical)
The Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents
in Unix and Unix-like operating systems, maintained by the Linux Foundation. The current version is
2.3, announced on 29 January 2004.[1]
Contents
[hide]
1 Directory structure
2 FHS compliance
3 History
o 3.1 Release history
4 See also
5 References
6 External links
Directory structure[edit]
In the FHS all files and directories appear under the root directory "/", even if they are stored on
different physical or virtual devices. Note however that some of these directories may or may not be
present on a Unix system depending on whether certain subsystems, such as the X Window
System, are installed.
The majority of these directories exist in all UNIX operating systems and are generally used in much
the same way; however, the descriptions here are those used specifically for the FHS, and are not
considered authoritative for platforms other than Linux.
Directory
/
/
b
i
n
/
b
o
o
t
/
d
e
v
Description
Primary hierarchy root and root directory of the entire file system hierarchy.
Essential command binaries that need to be available in single user mode; for all
users, e.g., cat, ls, cp.
/
o
p
t
/
s
g
m
l
/
X
There has been controversy over the meaning of the name itself. In early
versions of the UNIX Implementation Document from Bell labs, /etc is
referred to as the etcetera directory,[2] as this directory historically held
everything that did not belong elsewhere (however, the FHS restricts /etc to
static configuration files and may not contain binaries).[3]Since the
publication of early documentation, the directory name has been redesignated in various ways. Recent interpretations includebackronyms such
as "Editable Text Configuration" or "Extended Tool Chest".[4]
1
1
/
x
m
l
/
h
o
m
e
/
l
i
b
/
l
i
b
<
q
u
a
l
>
/
m
e
d
i
a
/
m
n
t
/
o
p
t
Optional application
software packages.[5]
/
p
r
o
c
/
r
o
o
t
/
s
b
i
n
Essential
system
binaries, e.g.,
init, ip, mount.
/
s
r
v
Sitespecific
data which
are served
by the
system.
Tempo
rary
files
(see
also /
/
t
m
p
/
u
s
r
var/
tmp ).
Often
not
preser
ved
betwee
n
system
reboot
s.
Se
co
nd
ar
y
hi
er
ar
ch
yf
or
re
ad
on
ly
us
er
da
ta;
co
nt
ai
ns
th
e
m
aj
or
ity
of
(
m
ult
i)u
se
r
uti
lit
ie
s
an
d
ap
pli
ca
tio
ns
.[6]
/
b
i
n
N
o
n
e
s
s
e
n
t
i
a
l
c
o
m
m
a
n
d
b
i
n
a
r
i
e
s
(
n
o
t
n
e
e
d
e
d
i
n
s
i
n
g
l
e
u
s
e
r
m
o
d
e
)
;
f
o
r
a
l
l
u
s
e
r
s
.
/
i
n
c
l
u
d
e
S
t
a
n
d
a
r
d
i
n
c
l
u
d
e
f
i
l
e
s
.
/
l
i
b
L
i
b
r
a
r
i
e
s
f
o
r
t
h
e
b
i
n
a
r
i
e
s
i
n
/
u
s
r
/
b
i
n
/
a
n
d
/
u
s
r
/
s
b
i
n
/
.
/
l
i
b
<
A
l
t
e
r
n
a
q
u
a
l
>
t
e
f
o
r
m
a
t
l
i
b
r
a
r
i
e
s
(
o
p
t
i
o
n
a
l
)
.
/
l
o
c
a
l
/
s
b
i
n
/
s
h
a
r
e
/
s
r
c
/
X
1
1
R
6
/
v
a
r
/
c
a
c
h
e
/
l
i
b
/
l
o
c
k
/
l
o
g
/
m
a
i
l
/
o
p
t
/
r
u
n
/
s
p
o
o
l
/
m
a
i
l
/
t
m
p
FHS compliance[edit]
Most Linux distributions follow the Filesystem Hierarchy Standard and declare it their own policy to
maintain FHS compliance.[9][10][11][12]GoboLinux is an example of an intentionally non-compliant
filesystem implementation.[13]
Some distributions that generally follow the standard deviate from it in some areas. Common
deviations include:
Modern Linux distributions include a /sys directory as a virtual filesystem (sysfs, comparable
to /proc , which is a procfs), which stores and allows modification of the devices connected to
the system, whereas many traditional UNIX and Unix-like operating systems use /sys as
a symbolic link to the kernel source tree.[citation needed]
Modern Linux distributions include a /run directory as a temporary filesystem (tmpfs) which
stores volatile runtime data, and which is being considered for the next version of the
FHS.[14] According to the FHS version 2.3, this data should be stored in /var/run but this was a
problem in some cases because this directory isn't always available at early boot. As a result,
these programs have had to resort to trickery, such as
using /dev/.udev , /dev/.mdadm , /dev/.systemd or /dev/.mount directories, even
though the device directory isn't intended for such data.[15] Among other advantages, this makes
the system easier to use normally with the root filesystem mounted read-only.
This is a detailed example from Debian:[16]
/dev/.* /run/*
/dev/shm /run/shm
/dev/shm/* /run/*
/lib/init/rw /run
/var/lock /run/lock
/var/run /run
/tmp /run/tmp
Many modern UNIX systems (like FreeBSD via its ports system) install third party packages
into /usr/local while keeping locally developed code in /usr .
Some Linux distributions no longer differentiate between /lib versus /usr/lib and
have /lib symlinked to /usr/lib .
History[edit]
When the FHS was created, other UNIX and Unix-like operating systems already had their own
standards. Notable examples are these: the hier(7) description of file system layout,[17] which has
existed since the release of Version 7 Unix (in 1979); the SunOSfilesystem(7)[18] and its
successor, the Solaris filesystem(5).[19][20]
Release history[edit]
Meaning
Red
Green
Current Standard
Blue
Future Draft
Version
Release
Date
Notes
v1.0
1994-02-14
FSSTND[21]
v1.1
1994-10-09
FSSTND[22]
v1.2
1995-03-28
FSSTND[23]
v2.0
1997-10-26
FHS 2.0 is the direct successor for FSSTND 1.2. Name of the standard was changed to Filesystem
Hierarchy Standard.[24][25][26]
v2.1
2000-04-12
FHS[27][28][29]
v2.2
2001-05-23
FHS[30]
v2.3
2004-01-29
FHS[31]
v3.0
under
FHS[32]
development