The Linux Filesystem Hierarchy Standard (FHS)
What /etc, /var, /usr, and the rest actually store, and why the layout is standardized. · 9 min
Linux organizes everything under a single root directory, `/` — there are no separate drive letters like `C:\`; even a second disk gets mounted as a subdirectory somewhere under `/`. The Filesystem Hierarchy Standard (FHS) defines what each top-level directory is conventionally used for, and while distributions vary slightly, the core layout is consistent enough that "where does X live" has a predictable answer almost everywhere.
`/etc` holds system-wide configuration files (almost everything you'll edit as an administrator lives here). `/var` holds variable data that changes as the system runs — logs (`/var/log`), spool files, caches. `/home` holds personal directories for each user. `/usr` holds the bulk of installed software and its supporting files — despite the name, it does not mean "user". `/bin`, `/sbin`, `/usr/bin`, `/usr/sbin` hold executables (the sbin variants are conventionally for system administration commands). `/tmp` holds temporary files that may be cleared on reboot. `/proc` and `/sys` are virtual filesystems — they don't store data on disk at all, but expose live kernel and process information as if it were files, which is how tools like `ps` and `free` get their data.
`/root` is the root user's home directory (distinct from the root of the filesystem, `/` — a common early point of confusion). `/opt` conventionally holds optional third-party software not managed by the distribution's package manager. `/mnt` and `/media` are conventional mount points for manually mounted and removable media respectively. Knowing this map means that on a completely unfamiliar server, you already know roughly where to look for a given category of file before you've read a single piece of that system's specific documentation.
| Command | Purpose | Example |
|---|---|---|
| tree | Display a directory structure as a visual tree (may need installing) | tree -L 2 /etc |
| df -h | Show disk space usage per mounted filesystem, human-readable | — |
- • /etc — system-wide configuration
- • /var — logs, caches, and other data that changes at runtime
- • /home — personal user directories
- • /usr — the bulk of installed software
- • /tmp — temporary files
- • /proc, /sys — virtual, kernel/process information, not real files on disk
Takeaway: The FHS layout is consistent enough across distributions that "which directory holds X" is almost always answerable from this map alone, before you've read that system's specific documentation.