The layout of
directories in a
Unix Filesystem is based loosely (or strictly, depends on the distro) on the
Filesystem Hierarchy
Standard (
FHS) a standard initially drafted
February 14,
1994 for the purposes of standardizing the
directory tree of various
Linux distros, but as of
1995, the scope of the
FHS has been expanded to
include commercial and
BSD style
Unicies.
Layout
Under the FHS standard, directories are layed out as given by the following table. Italics indicate optional
directories and bold face indicates required sybolic links to the directory given.
- /
- bin/
- boot/
- dev/
- etc/
- X11/
- opt/
- home/
- lib/
- modules/
- mnt/
- opt/
- root/
- sbin/
- tmp/
- usr/
- X11R6/
- bin/
- X11/ -> /usr/X11R6/bin
- mh/
- games/
- include/
- X11/ -> /usr/X11R6/include/X11
- bsd/
- g++/
lib/
- X11 -> /usr/X11R6/lib/X11
local/
- bin/
- games/
- include/
- lib/
- sbin/
- share/
- src/
sbin/
share/
- dict/
- doc/
- games/
- info/
- locale/
- man/
- man1/
- man2/
- man3/
- man4/
- man5/
- man6/
- man7/
- man8/
nls/
misc/
terminfo/
tmac/
zoneinfo/
src/
spool/ -> /var/spool/
- locks -> /var/lock/
tmp/ -> /var/tmp/
var/
- account/
- cache/
- fonts/
- man/
- www/
- <package>/
crash/
games/
lib/
- misc/
- <editor>/
- xdm/
- <pkgtool>/
- <package>/
lock/
log/
mail/
opt/
run/
spool/
- lpd/
- <printer>/
- mqueue/
- news/
- rwho/
- uucp/
tmp/
yp/
Notes & Explanations - organized by list number
1. This is the directory under which all other directories are organized. Files should never be created here.
1.1. Contains essential user binaries. This directory should have no subdirectories.
1.2. Contains static files for the boot loader. The kernel is located either here or in /
1.3. Contains files that represent devices on the Unix system.
1.4. Host specific configuration. Should contain no binaries, only configuration files and some initialization scripts.
1.4.1. Configuration for the X11 window system.
1.4.2. Configuration for /opt
1.5. Suggested placement for user directories and files.
1.6. Essential shared libraries and kernel modules.
1.6.1. Contains aforementioned kernel modules.
1.7. Mount points for temporarily mounted filesystems.
1.8. Contains add-on application software packages.
1.9. Home directory for the root user.
1.10. System binaries - utilities for system administration and other root-only commands are stored here
1.11. Temporary files - these files may be deleted in a site specific manner, and are used for temporary storage.
1.12. Shareable, read only data.
1.12.1. X11 windows system binaries, libraries and includes.
1.12.2. The primary directory of commands on the system.
1.12.2.2. Commands for the MH mail handling system.
1.12.3. Directory for standard includes for C/C++.
1.12.4. Libraries for programming and packages.
1.12.5. Local hierarchy for the system administrator when installing software locally. This differs from /usr in that files installed to here are not a part of the standard Unix distribution that installed all the system files.
1.12.7. Non-essential system administrator binaries.
1.12.8. Architecture independent data.
1.12.8.1. Word lists.
1.12.8.2. Miscellaneous documentation.
1.12.8.4. GNU info's primary directory.
1.12.8.5. Locale information.
1.12.8.6.1. User programs manuals.
1.12.8.6.2. System call manuals.
1.12.8.6.3. Library call manuals.
1.12.8.6.4. Special File manuals.
1.12.8.6.5. File Format manuals.
1.12.8.6.6. Games manuals.
1.12.8.6.7. Miscellaneous manuals.
1.12.8.6.8. System administration manuals.
1.12.8.7. Native language support.
1.12.8.8. Miscellaneous architecture independent data.
1.12.8.9. Directories for terminfo database.
1.12.8.10. troff macros not distributed with groff.
1.12.8.11. Timezone info and configuration.
1.12.9. Non-local source code.
1.13. Variable data.
1.13.1 Process account logs (if supported)
1.13.2 Cached data ...
1.13.2.1. ... for generated font data.
1.13.2.2. ... for manual pages.
1.13.2.3. ... for www pages.
1.13.2.4. ... for <package>.
1.13.3. System crash dumps (if supported).
1.13.4. Variable game data.
1.13.5. Variable state information.
1.13.6. Lock files.
1.13.7. Log files and directories.
1.13.8. User mailbox files.
1.13.9. Variable data for /opt.
1.13.10. Data relevant to running processes.
1.13.11. Application spool data.
1.13.11.1. Data for printers/printing processes.
1.13.11.2. Mail queue data.
1.13.11.3. News data.
1.13.11.4. Remote who data.
1.13.11.5. Unix to Unix copy data.
1.13.12. Temporary data preserved between system reboots.
1.13.13. Network Information Service (NIS) database files.
All data paraphrased from "Filesystem Hierarchy Standard - Version 2.1", published by the Filesystem Hierarchy group.