Skip to main content
>_ supraj.dev
TOPIC LINUX
Filesystem Hierarchy why /var, /etc, /opt exist
IN 10 SECONDS

Linux strictly structures directories: /etc for static configuration files, /var for variable data (logs, caches), /bin for user binaries, and /opt for third-party software packages.

GOTCHA Running out of space in /var can crash your database or logging daemon since they cannot write state updates.
HOW FILESYSTEM LOOKUPS FLOW
01 Root all file lookups start at the single root directory (/).
02 /etc services read static configurations (like hostnames, networks) here during startup.
03 /var services write operational logs and state data continuously.
04 /usr/bin system executes core user CLI tools and packages.
POKE IT YOURSELF
df -h — check free space on all mounted filesystems
du -sh /var/log/* — measure directory space usage