~/.config/ | Per-app user config (XDG standard) | ~/.config/git/config, ~/.config/nvim/ |
~/.local/bin/ | Your personal scripts/binaries, no sudo needed | pip install --user, custom CLI tools |
~/.local/share/ | Per-user app data | ~/.local/share/nvim/, language toolchain data |
~/.cache/ | Per-user cache, safe to wipe | build caches, ~/.cache/pip |
/etc/ | System-wide config (needs sudo) | /etc/nginx/nginx.conf, /etc/hosts, /etc/environment |
/usr/bin, /usr/local/bin | Installed CLI tools | where apt/brew/make install put binaries |
/usr/local/ | Anything you build from source system-wide | /usr/local/bin, /usr/local/lib |
/opt/ | Big vendor tools installed as a bundle | /opt/homebrew, IDEs, SDKs |
/var/log/ | Logs for services you run | /var/log/nginx/, /var/log/myapp/ |
/var/lib/ | Persistent state for services | Postgres/MySQL data dirs, Docker’s data root (/var/lib/docker) |
/var/cache/ | Regenerable cache, safe to delete | package manager cache (/var/cache/apt) |
/var/tmp/ | Temp files that survive reboot | long-running job output you don’t want wiped by a restart |
/var/spool/ | Queued jobs awaiting processing | cron jobs, print/mail queues |
/run/ | Runtime-only data since last boot, wiped on reboot | PID files, unix sockets — e.g. Docker’s socket at /run/docker.sock, a dev server’s .pid file |
/tmp/ | Scratch space, gone on reboot | build temp files, quick test output |
/srv/ | Content your machine serves | local web root, self-hosted git repos |
/media/ | Auto-mounted removable media | USB drive or SD card plugged in gets mounted here automatically |
/mnt/ | Manual/temporary mounts you set up yourself | mounting a network share or extra disk by hand: sudo mount /dev/sdb1 /mnt/backup |