FHS Filesystem Hierarchy Standard
The Filesystem Hierarchy Standard, or FHS, is a set of conventions that helps organize files and directories in Linux and Unix-like systems. It is maintained by the Linux Foundation and is widely used across distributions such as Ubuntu, CentOS, and Fedora.
The main goal is simple: make file locations predictable. Instead of guessing where a configuration file, log, or binary should live, users and tools can rely on a shared structure.
Two design principles stand out. First, the base operating system and application files are often kept separate from user data. The core system can be mounted as read-only, while logs, caches, and personal data tend to change over time. Second, FHS focuses on where files should reside rather than how they should be implemented.
Understanding the Top-Level Directories
In Linux, all files and directories live under the root directory, /. The FHS defines several top-level directories with specific responsibilities.
/bin: essential binaries used in normal and single-user mode, such asls,cp, andmkdir./boot: startup files, including the kernel and boot loader configuration./dev: device files that represent hardware./etc: host-specific configuration files and directories./home: default location for user data./lib: shared libraries and kernel modules./media: temporary mount point for removable media./mnt: temporary mount point for administrators./opt: third-party or vendor-specific software./proc: virtual filesystem for kernel and process information./root: home directory for the superuser./sbin: system administration binaries./srv: data served by the system, such as web or FTP content./sys: virtual filesystem for kernel devices and drivers./tmp: temporary files./usr: non-core software and read-only data./var: variable data such as logs, mail, queues, and caches.
The Roles of /usr and /var
The directories /usr and /var are especially important in real-world operations.
/usr: Software and Read-Only Data
Although the name may suggest “user,” /usr is more closely related to Unix software resources. It commonly contains:
/usr/bin: most application and system binaries./usr/sbin: system administration commands./usr/lib: application libraries./usr/local: locally installed software./usr/share: architecture-independent data, such as manuals and icons.
/var: Dynamic State
In contrast, /var is designed for data that changes while the system is running. It often includes:
/var/log: system and application logs./var/mail: user mailbox files./var/spool: task queues, such as print or mail queues./var/www: web server content in some distributions.
Why FHS Matters
FHS provides practical value for developers and system administrators.
- It helps teams write scripts that work across distributions.
- It improves troubleshooting by pointing to likely locations for logs and configuration.
- It supports better disk planning by separating static and dynamic data.
For example, a support engineer who knows that logs usually live under /var/log can quickly check system behavior. A developer who knows that configuration belongs under /etc can avoid placing files in the wrong place.
Final Thoughts
The FHS does not describe every implementation detail, but it offers a strong shared foundation. Even when distributions make small changes, the core hierarchy remains widely recognizable. Understanding FHS is a valuable step toward mastering Linux system administration and development.