C.W.K.
Stream
Lesson 01 of 12 · published

The Filesystem Tree

~15 min · filesystem, fhs, macos, tree

Level 0Window Tourist
0 XP0/95 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

One root, branches everywhere

Unix filesystems are a single tree rooted at /. There are no C: and D: drives — every disk, every USB stick, every network share gets mounted into that one tree. When you list /, you see the whole world.

The standard top-level directories

The Filesystem Hierarchy Standard (FHS) names each branch:

  • / — root, the only one
  • /bin, /sbin — essential binaries (boot-time tools)
  • /usr/bin, /usr/local/bin — third-party binaries
  • /etc — system-wide config files
  • /var — variable data (logs, caches, mail)
  • /tmp — temporary files, often wiped at reboot
  • /home (Linux) / /Users (macOS) — user homes
  • /opt — optional / third-party packages
  • /dev — device files (every disk, every tty)
  • /proc, /sys — Linux-only kernel views

macOS oddities

macOS adds its own folders: /Applications, /Library, /System, /Volumes. On Apple Silicon, Homebrew lives at /opt/homebrew; on Intel Macs it was /usr/local. Since macOS Catalina the system volume is read-only — you'll see a separate /System/Volumes/Data for writable user data, with hard-link magic so paths still look normal.

Mounted volumes

External disks appear under /Volumes on macOS, /media or /mnt on Linux. mount with no args lists every mounted filesystem. df -h tells you how much each has free.

Code

Walk the top of the tree·bash
ls /
ls /etc | head
ls /Applications        # macOS
df -h
mount | head
Visualize the tree·bash
brew install tree
tree -L 1 /
tree -L 2 /usr

External links

Exercise

Run ls / and read the names. Then tree -L 1 /usr and notice the bin / lib / share split. On macOS, ls /Volumes lists every mounted disk — plug in a USB stick, run again, see it appear.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.