Linux Filesystem cheatsheet

DirWhat’s in thereQuick vibe
/etcSystem-wide config (fstab, ssh/, apt/…)Brain – tweak here, bend the OS
/binCore binaries (ls, cp, bash)First-aid toolkit; always present, even in rescue mode
/sbinSysadmin binaries (mount, ip, systemctl)Same as /bin but root-only toys
/usr/binFull app set (gcc, python)Userland galaxy – 90 % of commands
/usr/sbinHeavier daemons (sshd, cron)Admin apps still in userland
/usr/localLocally compiled stuffKeeps your builds safe from the distro’s package manager
/varLogs, spool, caches, DB filesGrowing stomach – watch disk usage
/run (/var/run)Volatile runtime state (PIDs, sockets)tmpfs in RAM, born early at boot
/homeUsers’ dirsYou, your dotfiles, your mess
/opt3rd-party bundles (Chrome, VMware)Vendor playground; easy to nuke
/devDevice nodes (/dev/sda, /dev/null)“Everything’s a file” made real
/procKernel + process pseudo-FScat /proc/cpuinfo = free hardware probe
/sysKernel objects, driversModern cousin of /proc; tweak power/LEDs
/tmpScratch spaceAuto-purged; don’t stash secrets
/bootKernel & 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

OSRootApps live inUser homesMount style
🐧 Linux/*BSD//usr/bin, /opt/home/ivanAny device mounts anywhere (/mnt/usb) via fstab
macOS//Applications (GUI), /usr/bin (CLI)/Users/ivanExternal drives auto-mount under /Volumes
WindowsC:\C:\Program Files / Program Files (x86)C:\Users\IvanLetters (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.


TODOs

  • Break out /proc & /sys deep dive
  • Write a note on permissions & chmod octals
  • Draft a Mac vs Linux path mash-up table