π What Is the Linux File System Hierarchy?
Linux follows the Filesystem Hierarchy Standard (FHS) — a guideline that defines how directories should be organized under the root directory /.
This structure keeps Linux systems consistent across distributions and ensures predictable locations for binaries, configs, logs, and user data.
ποΈ Key Directories and Their Roles
| Directory | Purpose |
|---|---|
| / | Root of the entire file system — everything starts here |
| /bin | Essential user binaries (e.g., ls, cp, mv) |
| /etc | System configuration files |
| /var | Variable data like logs, mail, cache, spool files |
| /home | User home directories (e.g., /home/rsh, /home/alice) |
| /usr | Secondary hierarchy: user applications, libraries, documentation |
| /tmp | Temporary files; often cleared on reboot |
| /opt | Optional or third-party software packages |
| /dev | Device files for hardware and virtual devices |
| /proc | Virtual filesystem with runtime process and kernel data |
π§ Why It Matters
β Troubleshooting
Knowing where logs (/var/log) and configs (/etc) reside makes diagnosing system issues faster.
β Security
Misplacing files — especially configs or logs — can lead to data exposure.
β Automation
Scripts and services rely on consistent directory paths. Understanding FHS ensures reliable automation.
π§° Pro Tips
-
Check disk usage in variable directories:
-
Audit configuration changes with:
-
Avoid putting custom binaries in
/or/home— use:-
/optfor optional packages -
/usr/local/binfor custom executable scripts
-
π What’s Next?
In Post #8, we’ll explore Linux Disk Management — using df, du, mount, and fdisk to inspect, mount, and manage storage devices.
FAQs (0)
Sign in to ask a question. You can read FAQs without logging in.