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.
# 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 processMany 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
1. What standard defines the purpose of Linux's top-level directories?
2. Where would you look for system-wide log files by default?
3. What is unique about /proc compared to a directory like /etc?
4. Why is /root kept separate from /home?
5. What does the 'usr merge' refer to in modern distributions?
Was this page helpful?
You May Also Like
What Is Linux?
An introduction to Linux as a kernel and family of operating systems: its history, the GNU/Linux relationship, and why it dominates servers, cloud, and embedded devices.
Navigating the Filesystem (cd, pwd, ls)
Practical mastery of moving around the Linux directory tree using cd, pwd, and ls, including absolute vs relative paths and useful ls flags for everyday work.
File Permissions Explained (rwx)
Understand the Linux permission model — read, write, and execute bits for owner, group, and others — and how ls -l output maps to those permissions.
Disk Usage and Management (df, du, mount)
Learn how to inspect filesystem capacity, measure directory sizes, and understand how block devices get attached to the Linux directory tree via mounting.
Related Reading
Related Study Notes in DevOps
Browse all study notesNginx Study Notes
DevOps · 30 topics
DevOpsAnsible Study Notes
DevOps · 30 topics
DevOpsAdvanced Kubernetes Study Notes
Kubernetes · 30 topics
DevOpsAdvanced Bash Scripting Study Notes
Bash · 30 topics
DevOpsApache Kafka Study Notes
Kafka · 30 topics
DevOpsDocker & Kubernetes Study Notes
YAML · 40 topics