Linux file system hierarchy.
Linux has a place for everything. Programs live in /usr, configuration lives in /etc, logs live in /var/log, user data lives in /home. Eight animated steps β one for each big directory β and you'll know where to look for any file.
Linux File System Hierarchy Standard (FHS) animated tour. Top-level directories: /home, /etc, /var, /usr, /tmp, /opt, /proc, /dev. Covers RHCSA EX200 exam objectives for filesystem layout.Linux organizes every file on the system under a single root directory called /. Below it sit a small number of well-known top-level directories β each with a specific job. Learn the eight big ones and you'll know where to look for anything.
- Β·Comfortable using cd, ls, and cat at the shell (if not, do the Command Line lesson first)
- Β·Roughly what 'a file' and 'a directory' are
Name the eight key top-level directories on a Linux system, say what each is for, and know which directory to look in for any common file.
pace: 8 minutes
/ β the root of everything
Linux has exactly one root directory. Every path on the system, regardless of which disk or partition it physically lives on, starts here. When you mount a USB drive at /mnt/usb, that mount point is just a subdirectory of /. There is no separate C: or D: drive β it's all one tree.
/homeΒ·user data/etcΒ·system configuration/varΒ·logs, mail, web roots β data that grows/usrΒ·installed programs and libraries/tmpΒ·temporary files/procΒ·kernel and process info (not on disk)/devΒ·device files (disks, terminals, /dev/null)/optΒ·optional third-party software$ls /$tree -L 1 /$df -hThe standard is called the FHS (Filesystem Hierarchy Standard). It's why your script that reads /etc/passwd works the same on RHEL, Debian, Arch, and Alpine. Knowing the FHS basics turns "where do I look?" into "I know where to look" β and that's most of what makes a sysadmin productive.
/the root β everything lives below/binessential commands (often symlink to /usr/bin)/sbinessential admin commands (often β /usr/sbin)/bootkernel images, initramfs, GRUB config/devdevice files (disks, terminals, /dev/null)/etcsystem-wide configuration/homeregular user home directories/libessential shared libs (often β /usr/lib)/mediaauto-mount points for removable media/mntmanual mount points (admin's playground)/optoptional third-party software/procvirtual: kernel + per-process info/rootthe root user's home directory/runruntime data β PIDs, sockets, locks (tmpfs)/srvdata for services (rarely used in practice)/sysvirtual: kernel devices, drivers, sysfs/tmptemp files, often tmpfs, cleared periodically/usrprograms + libraries from the package manager/varvariable data β logs, mail, caches, web rootsYou need to read SSH server settings. Which directory holds the config?
A disk filled up overnight. What directory should you investigate first?
What's special about /proc?
You ran `cat report.txt > /dev/null`. What happened?
These aren't graded β they're just for active recall, which is what actually makes the lesson stick.