I often find myself forgetting Linux’s directory structure and its cryptic names, so this document serves as a quick reference for me. Who knows, maybe someone else will find it useful as well?
(vfs) indicates that the directory is a virtual file system
and does not contain “real” files. I didn’t verify all of the
marks, though, so do your own research.
(Also, you can interpret “binaries” as executables or programs.)
|directory||naming justification||extra notes|
||system binaries||(for sysadmins)|
||shared libraries||(for binaries to use)|
||optional third-party binaries|
||users’ home directories||(default current directory)|
||root user’s home directory|
||bootloader files||(kernels, initrd)|
||configuration files||(for system, services)|
||server files||(HTTP, FTP services)|
||variable data||(log files, print queues)|
||temporary files||(usually cleared on reboot)|
||mounted file systems|
||media devices||(removable media, USBs)||(vfs)|
Of course, there are more directories, but these are the basic ones you should know,
and any more involved directories (such as
/run) can be googled by you.
The distinction between
/opt is muddied and I don’t really
understand it. As with most decade-old+ software, a lot of the ambiguity has to do with historical reasons.
Here’s a good discussion
I found on the matter.
must be on root partition:
must be on same partition:
make a separate partition for:
also recommended to make a partition for:
/home(so users can’t fill important drives)
/var(can fill up with lots of data)