The Linux File System Hierarchy

The file system hierarchy

The Linux File System Hierarchy

All files on a Linux system are stored on file systems which are organized into a single inverted tree of directories, known as a file system hierarchy. This tree is invited because the root of the tree is said to be at the top of the hierarchy, and the branches of directories and sub-directories stretch below the root.

The Linux File System Hierarchy


The directory / is the root directory at of the top of the file system hierarchy. The / character is also used as a directory separator in file names. For example, if etc is a sub-directory of the / directory, we could call that directory /etc . likewise, if the /etc directory contained a file named issue, we could refer to that file as /etc/ issue.

Sub-directories of / are used for standardized purposes to organize files by type and purpose. This makes it easier to find files. For example, in the root directory, the sub-directory /boot is used for storing files needed to boot the system.

The following table lists some of the most important directories on the system by name and purpose.


Important Linux directories



Location Purpose
/usr Installed software, shared libraries, include files, and
static read –only program data. Important sub-directories include:
-/usr/bin: User commands.
-/usr/sbin: System administration commands.
-usr/local: Locally customized software.
/etc Variable data specific to this system that should persist between boots. Files that
dynamically change (e.g. databases, cache directories, log files, printer
spooled documents, and website content) may be found under /var.
/run Run-time data for processes started since the last boot. This includes process ID files
and lock files, among other things. The contents of this directory are
recreated on reboot.
/root Home directory for the administrative super-user, root.
/home Home directories where regular users store their personal data and configuration
files.
/tmp A world-writable space for temporary files. Files which are more than 10 days old
are deleted from this directory automatically. Another temporary directory exist,
/var /tmp, in which files that have not been accessed, changed, or modified in
more than 30 days are deleted automatically.
/boot Files needed in order to start the boot process.
/dev Contains special device files which are used by the system to access hardware.
/dev Contains special device files which are used by the system to access hardware.


Tech info

Comments