LINUX / A CONCEPT NOTE
Filesystem Hierarchy
why /var, /etc, /opt exist
Overview · mechanism
pitfall · examples
01 / THE SHORT VERSION
The idea in a few sentences.
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.
02 / FOLLOW THE MECHANISM
How filesystem lookups flow
Root
all file lookups start at the single root directory (/).
/etc
services read static configurations (like hostnames, networks) here during startup.
/var
services write operational logs and state data continuously.
/usr/bin
system executes core user CLI tools and packages.
04 / COMMAND NOTES
Read the command, then the result.
Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.
check free space on all mounted filesystems
df -hmeasure directory space usage
du -sh /var/log/*05 / CHECK YOURSELF
Could you explain Filesystem Hierarchy to a teammate?
Try it out loud in two sentences: what it is, and the one detail that changes the picture. If you stall, the gap is the part to reread.
Up next in Linux & systemsPipes & Redirectionhow commands chain