The Filesystem Hierarchy Standard (FHS), maintained by the Linux Foundation, defines the directory tree used by Linux and most Unix-like operating systems — making it possible to write software, scripts, and tools that work consistently across distributions. Understanding this hierarchy is foundational to system administration, debugging, and security: when something goes wrong on a Linux system, knowing exactly where logs live, where binaries are found, and how virtual filesystems expose kernel state can mean the difference between a quick fix and hours of confusion. A key mental model: the Linux filesystem is a single tree rooted at /, and every device, network share, or virtual interface is mounted as a subtree within it — nothing is outside the tree.
What This Cheat Sheet Covers
This topic spans 15 focused tables and 141 indexed concepts, 134 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Root Filesystem Top-Level Directories
The root directory / is the anchor point for every path on a Linux system. Each immediate child of / has a carefully defined role under FHS 3.0, and understanding what belongs where prevents both misconfiguration and unnecessary confusion when navigating an unfamiliar machine.
| Directory | Example | Description | |
|---|---|---|---|
/bin/ls, /bin/bash | • Essential user command binaries needed in single-user mode and before /usr is mounted• on modern distros a symlink to /usr/bin via usrmerge | ||
/etc/passwd, /etc/fstab | • Host-specific system configuration files • must be static text — no binaries • the central nerve centre for system behaviour | ||
/var/log/syslog, /var/spool/mail | Variable data that changes during normal operation: logs, spools, caches, and runtime state. | ||
/usr/bin/python3, /usr/lib/ | • Shareable, read-only user data • the second major section • contains the bulk of installed programs and libraries | ||
/home/alice/.bashrc | • User home directories • each user's personal data, configuration dotfiles, and settings live here | ||
mktemp /tmp/tmpXXXXXX | • Temporary files • deleted on reboot (often tmpfs) • writable by all users • sticky bit set so users cannot delete each other's files | ||
/dev/sda, /dev/null | • Device files — character and block devices • managed at runtime by udev on devtmpfs | ||
/proc/cpuinfo, /proc/1234/ | • Virtual filesystem (procfs) exposing kernel data structures and per-process information • nothing is stored on disk | ||
/sys/class/net/eth0/ | • sysfs virtual filesystem exporting the kernel device model • organised by buses, classes, and devices • mounted on /sys. | ||
/run/sshd.pid, /run/docker.sock | • Runtime variable data (tmpfs) • PID files, Unix sockets, and lock files valid only for the current boot — lost on reboot | ||
/boot/vmlinuz, /boot/grub/ | Static files needed to boot the kernel: kernel images, initramfs, and bootloader configuration. | ||
/lib/x86_64-linux-gnu/libc.so.6 | • Essential shared libraries supporting /bin and /sbin• also holds kernel modules under /lib/modules/. | ||
/sbin/fdisk, /sbin/init | • System binaries for administration, typically requiring root • on modern distros a symlink to /usr/sbin via usrmerge | ||
/opt/google/chrome/ | Add-on application packages — self-contained third-party software that bundles its own libraries. | ||
/root/.ssh/ | • Root user's home directory • separate from /home so it is accessible even if /home is not mounted | ||
mount /dev/sdb1 /mnt | Conventional temporary mount point for system administrators mounting filesystems manually. | ||
/media/usb0/, /media/cdrom/ | • Removable media auto-mount points • the desktop environment or udev mounts USB drives and optical discs here | ||
/srv/www/, /srv/ftp/ | • Site-specific service data served by this system (web, FTP, etc.) • intended for data owned by services | ||
/lost+found/ (each ext filesystem) | • fsck recovery directory present on every ext2/3/4 filesystem • orphaned inodes are placed here after a filesystem check |