1 / 8 · Book 19 · The Linux Directory Structure⊞ allnext →Get the book →
1.1The Filesystem Hierarchy
Linux organizes everything as files in a single directory tree starting from the root /. There is no C:\ drive, no D:\ drive. Everything -- your documents, your configurations, your hardware devices, even running processes -- is represented as a file somewhere under /. Understanding this structure helps you navigate test environments, find configuration files, and locate logs quickly.
Here is the standard Linux filesystem layout:
/ Root of the filesystem
├── home/user/ Your home directory (~)
├── etc/ Configuration files
├── var/
│ ├── log/ Application and system logs
│ └── lib/ Variable data (databases, packages)
├── tmp/ Temporary files (cleared on reboot)
├── opt/ Optional/third-party software
├── usr/
│ ├── bin/ User-installed binaries
│ └── local/ Locally compiled software
├── proc/ Virtual filesystem (process and kernel info)
├── dev/ Device files
└── srv/ Service data (web servers, FTP)
Each directory has a specific purpose. Knowing what lives where means you never have to guess where to look when something goes wrong.