4.3 The Filesystem Hierarchy Standard

Key Takeaways

  • The Filesystem Hierarchy Standard (FHS) defines the purpose of each top-level directory so files land in predictable places across distributions
  • /etc holds host-specific configuration, /var holds variable data such as logs and caches, and /boot holds the kernel, initramfs, and bootloader files
  • /proc and /sys are virtual filesystems created in memory by the kernel: /proc exposes processes and kernel state, /sys exposes devices and kernel objects
  • Kali is FHS-compliant, and on modern Debian/Kali the /usr merge makes /bin, /sbin, /lib, and /lib64 symlinks into their /usr counterparts
  • /root is the private home directory of the root user and is deliberately separate from /home
Last updated: July 2026

One Tree, Predictable Places

Linux has no drive letters. Every storage device is mounted somewhere inside a single directory tree whose top is the root directory, /. The Filesystem Hierarchy Standard (FHS) defines what each top-level directory is for, so that an administrator moving between Debian, Kali, Fedora, or a server appliance finds configuration, logs, and binaries in the same places. Kali is explicitly FHS-compliant, and the KLCP exam tests the purpose of individual directories directly.

The Core Directories

DirectoryPurpose
/binEssential user command binaries needed in single-user or rescue mode (e.g. ls, cp, cat)
/sbinEssential system administration binaries, traditionally for root (fdisk, ip, fsck)
/etcHost-specific, static configuration files (/etc/passwd, /etc/fstab, /etc/ssh/sshd_config) — no binaries
/varVariable data that changes while the system runs: logs (/var/log), caches, spool, databases
/tmpTemporary files; world-writable with the sticky bit (1777) and typically cleared at boot
/usrThe FHS secondary hierarchy — shareable, read-only data (the name is historically short for "user"; "Unix System Resources" is a later backronym): the bulk of installed software — /usr/bin, /usr/sbin, /usr/lib, plus shared data in /usr/share; historically mountable read-only and shareable between machines
/homeHome directories for regular users, e.g. /home/kali
/rootHome directory of the root user, kept outside /home so root can log in even if /home is a separate, unavailable mount
/bootStatic boot files: the kernel image (vmlinuz), the initial RAM disk (initrd.img), and the GRUB bootloader configuration
/devDevice files representing hardware, populated dynamically by udev
/procVirtual filesystem exposing processes and kernel state (/proc/cpuinfo, /proc/meminfo, /proc/<pid>/)
/syssysfs: virtual filesystem exposing devices, drivers, and kernel objects for udev and tuning
/optOptional, self-contained third-party application bundles (many security tools drop here)
/srvData served by the system itself (web roots, FTP content) when you run it as a server
/runVolatile runtime data (PID files, sockets) kept in RAM since the last boot
/media, /mntStandard mount points: /media for auto-mounted removable media, /mnt for temporary manual mounts

Virtual Filesystems Deserve Special Attention

/proc and /sys exist only in memory — the kernel fabricates their contents on read, and writing to some entries tunes the kernel live (for example echo 1 > /proc/sys/net/ipv4/ip_forward enables IP forwarding, a classic pivoting step). They consume no disk space, which you can confirm with du: the exam likes asking why /proc reports strange sizes.

The /usr Merge in Modern Debian and Kali

Historically, /bin, /sbin, /lib, and /lib64 held the bare minimum needed to boot before /usr (possibly on another disk) was mounted. Modern systems assemble an initramfs (initial RAM filesystem) early in boot, so that split no longer serves a purpose. Current Debian — and therefore current Kali — performs the /usr merge: those four top-level directories are now symbolic links into /usr:

$ ls -ld /bin /sbin /lib /lib64
lrwxrwxrwx 1 root root 7 /bin -> usr/bin
lrwxrwxrwx 1 root root 7 /lib -> usr/lib
lrwxrwxrwx 1 root root 9 /lib64 -> usr/lib64
lrwxrwxrwx 1 root root 8 /sbin -> usr/sbin

Practical consequences for the exam: a tool documented as living in /bin is physically stored in /usr/bin, both paths resolve to the same file, and scripts with a #!/bin/sh shebang keep working untouched. The old distinction between /bin and /usr/bin is effectively gone on a fresh Kali install.

Using the Layout in Practice

Knowing the FHS tells you where to look before you ever run a search. Hunting a service's settings? Start in /etc. Suspect a rootkit hid files? Check world-writable /tmp and /dev/shm. Need the kernel or want to back up boot configuration? Everything static is in /boot. Disk filling up? /var/log and /var/cache grow continuously, while /home holds user data. Triaging an odd process? Read /proc/<pid>/cmdline and /proc/<pid>/exe. Because Kali follows the FHS, lessons learned on any compliant distribution transfer directly — and because the exam is written from the Kali Linux Revealed book, directory-purpose matching questions (for example, 'where do variable data and logs live?' → /var) are common.

Looking Inside /var and /usr

Two directories reward a closer look because the exam tests their subdivisions. Under /var, the split is by lifecycle: /var/log holds log files (rotated by logrotate so disks do not fill), /var/cache holds data programs can regenerate or re-download if deleted, /var/lib holds persistent application state such as the dpkg database in /var/lib/dpkg that APT consults for every install, /var/tmp holds temporary files that must survive reboots (unlike /tmp), and /var/spool queues jobs such as mail and print tasks. Under /usr, the split is by content type: /usr/bin and /usr/sbin hold executables, /usr/lib holds libraries and architecture-dependent files, /usr/share holds architecture-independent data such as documentation, icons, and wordlists — on Kali this includes the famous /usr/share/wordlists, which ships rockyou.txt.gz (run sudo gunzip /usr/share/wordlists/rockyou.txt.gz before first use) — and /usr/local is reserved for software the administrator compiles and installs manually, so package managers never overwrite it. That last point is a favorite exam trap: locally compiled tools belong in /usr/local, not /opt (which is for self-contained third-party bundles) and not directly in /usr/bin (which the package manager owns).

Test Your Knowledge

During an engagement you need to review a target Kali machine's SSH daemon configuration and its authentication logs. Which pair of locations does the FHS dictate?

A
B
C
D
Test Your Knowledge

On a current Kali system you run ls -ld /bin and see /bin -> usr/bin. What does this indicate?

A
B
C
D