ITSC1358 – UNIX/Linux Administration Prof. Michael P. Harris
Linux (FHS) Filesystem Hierarchy Standard
In the Linux FHS (Filesystem Hierarchy Standard) all files and directories exist under the one, and only one, root directory “/”, even if they are stored on different physical or virtual devices or filesystems. Note that some of these directories may or may not be present on a given Linux system depending on whether certain subsystems, such as X―Windows, are installed.
The majority of these directories also exist in the UNIX operating system 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. This list is not an exhaustive list of the FHS directories.
Directory / Description // / The hierarchy top-level root directory of the entire filesystem. /
/bin / Essential command binaries that need to be available to boot the OS into single user mode; for all users. ex., cd, cat, ls, cp, mv, rm. /
/boot / Boot loader files, e.g., kernel, initrd. /
/dev / Essential device files, ex., /dev/null. /
/etc / Host-specific system-wide configuration files.
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, as this directory historically held everything that did not belong elsewhere. FHS however, restricts /etc to static configuration files and scripts and may not contain binaries. Since the publication of early GNU documentation, the directory name has been re-designated in various ways. Recent interpretations include backronyms such
as “Editable Text Configuration” or “Extended Tool Chest”. /
/etc/default / Backup copies of default system—wide configuration files. /
/etc/profile.d / Contains add-on scripts to run at user login. Script names must end in .sh. /
/etc/skel / Default user (new user) home directory configuration scripts. Hidden “.” files. /
/etc/X11 / Configuration files for the X—Window System, version 11. /
/home / All the users’ (except root) home directories, containing the individual users’ configuration scripts, saved files, personal settings, etc. /
/lib / Libraries essential for the binaries in /bin/ and /sbin/. /
/media / Mount points for removable media such as Flash Drives (enhances /mnt). /
/mnt / Mount points for temporarily mounted filesystems such as CD-ROMs. /
/opt / Optional application software packages. (Rarely used in Linux) /
/proc / Virtual filesystem providing information about process and kernel information in/as files. In Linux, this corresponds to a procfs mount. /
/root / Home directory for the Super User (root). /
/sbin / Essential system binaries. ex., init, mkfs, fsck, mount. /
/tmp / Temporary files (see also /var/tmp). Often deleted between reboots. /
/usr / Secondary hierarchy for read-only user data; contains the majority of shared (multi—)user utilities and applications. /
/usr/bin / Non-essential command binaries (see /bin); for all users. May contain links to all available user utilities/commands (binaries) /
/usr/include / Standard include files for ‘C’ programmers. /
/usr/lib / Libraries for the binaries in /usr/bin/ and /usr/sbin/. /
/usr/local / Tertiary hierarchy for local shared data, specific to this host. May be used instead of, or in addition to, /usr/share. /
/usr/sbin / Non-essential system binaries. e.g., daemons for various network-services. /
/usr/share / Architecture-independent user shared data. May be used instead of, or
in addition to, /usr/local, but more commonly in use. /
/usr/src / Source code. e.g., kernel and utility ‘C’ source code with it header files. /
/usr/X11R6 / The X—Windows window manager, Version 11, Release 6. /
/var / Variable files —files whose content is expected to continually change during normal operation of the system —such as logs, spool files, and temporary files. /
/var/cache / Application cached data. Data that is locally generated as a result of time-consuming I/O or calculations. The applications must be able to regenerate
or restore the data. The cached files can be deleted without loss of data. /
/var/lib / State information. Persistent data modified by programs as they run.
ex., databases, packaging system metadata, etc. /
/var/lock / Lock files. Files keeping track of resources currently in use. /
/var/log / Log files. Various OS and application logs. /
/var/run / Information about the running system since last boot.
e.g., currently logged-in users and running daemons. /
/var/spool / Spool files for tasks waiting to be processed. ex., print queues. /
/var/tmp / Temporary files to be preserved between reboots. (see also /tmp) /
Page 1 of 2