100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Bash

The Linux Filesystem Hierarchy

A tour of the standard Linux directory tree defined by the Filesystem Hierarchy Standard (FHS) — what lives under /etc, /var, /usr, /home, and more, and why the layout matters.

Linux FoundationsBeginner9 min readJul 9, 2026
Analogies

The Linux Filesystem Hierarchy

Unlike Windows, which assigns separate drive letters (C:, D:) to different storage devices, Linux presents everything — hard drives, USB sticks, network shares, even virtual kernel data structures — as a single unified tree rooted at '/'. Every file and directory on the system, regardless of which physical or virtual device it lives on, is reachable by a path starting from that root. This layout is formalized by the Filesystem Hierarchy Standard (FHS), a specification maintained by the Linux Foundation that defines what each top-level directory is for, so that software, documentation, and system administrators can rely on consistent, predictable locations across distributions.

🏏

Cricket analogy: Like a single unified scorebook covering every ground a team plays on rather than separate books per stadium the way Windows uses separate drive letters, Linux roots every file under one tree from '/', with the FHS as the official rulebook defining where records belong.

Core Top-Level Directories

/bin and /sbin hold essential command binaries and system administration binaries needed even in single-user recovery mode (on modern distros these are often symlinked into /usr/bin and /usr/sbin). /etc contains system-wide configuration files — nearly everything here is plain text and human-editable, from /etc/fstab (mounted filesystems) to /etc/ssh/sshd_config. /var holds variable data that changes as the system runs: logs (/var/log), spool files, and caches. /home contains one subdirectory per regular user for personal files, while /root is the home directory of the root superuser, kept separate so it remains accessible even if /home is on an unmounted or corrupted partition.

🏏

Cricket analogy: Like essential match-day equipment kept in a readily accessible kit bag even during a rain-delay lockdown, the team's rulebook and settings live in one labeled folder, growing scorecards sit separately, while a player's locker stays distinct from the captain's, which stays reachable even if the general locker room closes.

Virtual and Special-Purpose Directories

/proc and /sys are not real files on disk at all — they are virtual filesystems generated by the kernel on the fly, exposing live information about running processes, hardware, and kernel parameters as if they were ordinary files. For example, cat /proc/cpuinfo reads live CPU data straight from kernel memory. /tmp holds temporary files that may be cleared on reboot; /opt is conventionally used for optional, self-contained third-party software packages; /mnt and /media are standard mount points for manually mounted filesystems and removable media, respectively. /usr (historically 'Unix System Resources', not 'user') contains the bulk of installed software, libraries, and documentation shared across the system.

🏏

Cricket analogy: Like a live scoreboard display generated on the fly from the stadium's sensors rather than a stored file, a temporary chalk-marked practice pitch gets wiped after the session, a visiting franchise's equipment truck parks in a designated bay, and the stadium's own permanent gear sits in main storage.

bash
# Explore the hierarchy
ls -la /                     # list all top-level directories
tree -L 1 /                  # one-level tree view (install with: sudo apt install tree)

# Inspect key directories
ls /etc/                     # system configuration files
ls /var/log/                 # system and application logs
df -h /                      # disk usage of the root filesystem
mount | column -t            # show all currently mounted filesystems

# Read live kernel data via /proc
cat /proc/cpuinfo | head -5
cat /proc/meminfo | head -5
ls /proc/$$                  # /proc/<pid> for the current shell's own process

Many modern distributions (Fedora, Arch, and recent Debian/Ubuntu releases) have merged /bin, /sbin, and /lib into /usr/bin, /usr/sbin, and /usr/lib, leaving the old paths as symlinks. This 'usr merge' simplifies read-only root filesystems and atomic OS updates, but the FHS-defined logical locations still work exactly as before for scripting purposes.

Never manually edit or delete files under /proc or /sys unless you know precisely what you are doing — these virtual filesystems can control live kernel behavior. For example, writing to certain files under /proc/sys/ can immediately change networking behavior or memory management for the whole running system.

  • Linux uses a single unified directory tree rooted at '/' instead of drive letters.
  • The Filesystem Hierarchy Standard (FHS) defines the purpose of each top-level directory consistently across distributions.
  • /etc = configuration, /var = variable/log data, /home = user files, /usr = installed software and libraries.
  • /proc and /sys are virtual, kernel-generated filesystems reflecting live system state, not real files on disk.
  • /tmp is for temporary files, /opt is for optional third-party packages, /mnt and /media are standard mount points.
  • Many modern distros have merged /bin, /sbin, /lib into their /usr counterparts via symlinks ('usr merge').

Practice what you learned

Was this page helpful?

Topics covered

#Bash#LinuxShellScriptingStudyNotes#DevOps#TheLinuxFilesystemHierarchy#Linux#Filesystem#Hierarchy#Core#StudyNotes#SkillVeris