Linux Filesystem cheatsheet Dir What’s in there Quick vibe /etc System-wide config (fstab, ssh/, apt/…) Brain – tweak here, bend the OS /bin Core binaries (ls, cp, bash) First-aid toolkit; always present, even in rescue mode /sbin Sysadmin binaries (mount, ip, systemctl) Same as /bin but root-only toys /usr/bin Full app set (gcc, python) Userland galaxy – 90 % of commands /usr/sbin Heavier daemons (sshd, cron) Admin apps still in userland /usr/local Locally compiled stuff Keeps your builds safe from the distro’s package manager /var Logs, spool, caches, DB files Growing stomach – watch disk usage /run (/var/run) Volatile runtime state (PIDs, sockets) tmpfs in RAM, born early at boot /home Users’ dirs You, your dotfiles, your mess /opt 3rd-party bundles (Chrome, VMware) Vendor playground; easy to nuke /dev Device nodes (/dev/sda, /dev/null) “Everything’s a file” made real /proc Kernel + process pseudo-FS cat /proc/cpuinfo = free hardware probe /sys Kernel objects, drivers Modern cousin of /proc; tweak power/LEDs /tmp Scratch space Auto-purged; don’t stash secrets /boot Kernel & bootloader bits (vmlinuz, grub/) Small, often its own partition Why the weird names? usr ≠ “user” originally—Unix System Resources (/usr/bin). sbin = system binaries (super-user land). opt from optional add-ons in SVR4 days. run split from /var so early-boot services get instant writable RAM. Quick cross-OS compare OS Root Apps live in User homes Mount style 🐧 Linux/*BSD / /usr/bin, /opt /home/ivan Any device mounts anywhere (/mnt/usb) via fstab macOS / /Applications (GUI), /usr/bin (CLI) /Users/ivan External drives auto-mount under /Volumes Windows C:\ C:\Program Files / Program Files (x86) C:\Users\Ivan Letters (D:\, E:\) instead of grafting into a single tree Handy aliases & shortcuts ~ → home dir (/home/ivan, /Users/ivan). . = current dir, .. = parent. /var/run → symlink to /run on modern distros. /bin & /sbin often symlink to /usr/bin & /usr/sbin (the usr-merge trend). Mounting in one breath Linux glues extra filesystems into the tree:
mount /dev/sdb1 /media/usb
macOS auto-mounts to /Volumes/DriveName,
Windows splits the forests into drive letters.
...