Skip to main content

Filesystem Hierarchy

Unlike operating systems such as Windows, which use separate drive letters (C:, D:), Linux organizes everything into a single unified tree starting at the root /. Every file, directory, device, and process connects to this tree. To master Linux, you must understand the purpose of each directory and how they interconnect.


The Root of the Kingdom

  • / → The root directory, the starting point of all paths.
  • All files, libraries, and devices branch from /.
Mounting: External storage (USB, disks) are “mounted” into this tree, not given separate letters. This makes Linux flexible and consistent across systems.

Key Directories of Filesystem

Here are the guardians of the kingdom - the major directories you must know:

# Directory Purpose
1 /bin Essential binaries (e.g., ls, cp, mv) — the user’s basic tools.
2 /sbin System binaries for administrators (e.g., shutdown).
3 /etc Configuration files for services and applications.
4 /home Personal directories for users (e.g., /home/apprentice).
5 /root Private directory of the root (superuser).
6 /var Variable data: logs, spool files, caches.
7 /usr User applications, libraries, and documentation.
8 /tmp Temporary files, deleted after reboot.
9 /dev Device files (disks, USBs, terminals).
10 /proc Virtual filesystem with process and system information.
11 /sys Kernel and hardware information.
12 /opt Optional third-party software.
13 /run Runtime data such as PID files and sockets.

Navigating the Map

Use these commands to explore:

ls /              # List root directory contents
cd /etc           # Enter configuration directory
ls /home          # View user home directories
cat /proc/cpuinfo # Read CPU information
/proc and /sys are virtual filesystems - they don’t store data but provide live system info.

Practical Exercises

## Peek into memory usage:

cat /proc/meminfo
# → Inspect system logs:

ls /var/log
tail /var/log/syslog
# → Explore user accounts:

ls /etc
cat /etc/passwd
# → Explore the root directory:

ls /
# → Identify at least 5 key directories.

Hackers Quest - Mini Project

  • Document the purpose of /bin, /etc, /home, /var, /dev, /proc.
  • Add one real-world example of a file from each.
  • Reflect: Why does Linux unify everything under / instead of separate drives?

Hackers Notebook

The filesystem hierarchy is the blueprint of Linux. Each directory has its guardians, each file its purpose. To walk confidently in Linux, you must know not only the commands but also the locations where they reside.


Tips, Tricks, Roadmaps, Resources, Networking, Motivation, Guidance, and Cool Stuff ♥

Updated on Dec 28, 2025