- Notifications
You must be signed in to change notification settings - Fork 13
Linux File Hierarchy: Understanding the FHS for Unix‐like Systems
The Linux File Hierarchy Structure (FHS) or Filesystem Hierarchy Standard defines the directory structure and contents in Unix-like operating systems. It is maintained by the Linux Foundation.
- Primary hierarchy root and root directory of the entire file system hierarchy.
- Every single file and directory starts from the root directory.
- Only the root user has the right to write under this directory.
/root
is the root user’s home directory, which is not the same as/
.
- Essential command binaries that need to be available in single-user mode and for all users.
- Contains binary executables for common Linux commands used in single-user modes and by all users of the system.
- Boot loader files, such as kernels and initrd.
- Essential device files, such as
/dev/null
, terminal devices, and USB devices.
- Host-specific system-wide configuration files, including startup and shutdown scripts.
- Contains configuration files required by all programs.
- Users’ home directories, containing saved files and personal settings.
- Libraries essential for binaries in
/bin
and/sbin
.
- Mount points for removable media such as CD-ROMs.
- Temporarily mounted filesystems.
- Optional application software packages.
- Essential system binaries used by system administrators for maintenance purposes.
- Site-specific data served by the system, such as data for web servers and version control systems.
- Temporary files that are not preserved between system reboots.
- Secondary hierarchy for read-only user data and contains utilities and applications for users.
/usr/bin
contains binary files for user programs, and/usr/sbin
contains binaries for system administrators.- Libraries, documentation, and source code are also found in
/usr
.
- Virtual filesystem providing process and kernel information as files.
- Contains information about running processes and system resources.
Modern Linux distributions include a /run
directory as a temporary filesystem (tmpfs) which stores volatile runtime data, following the FHS version 3.0.
Understanding the Linux File Hierarchy Structure is crucial for navigating and managing Unix-like operating systems effectively. By familiarizing yourself with the key directories and their purposes, you gain insights into how the system is organized and where to find essential files and configurations. Whether you're a system administrator, developer, or Linux enthusiast, mastering the FHS enhances your ability to work efficiently within the Linux environment.
Happy exploring and navigating the Linux filesystem!
References: