Filesystem Hierarchy Standard
The Filesystem Hierarchy Standard outlines the conventional layout of UNIX systems and is largely adhered to by BSD and Linux (and macOS for the core userland ), though the specification only officially holds for Linux
https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
In particular, it establishes:
Path | Purpose |
---|---|
/ | Root directory of the system |
/bin | Critical command binaries needed to use the system |
/boot | Bootloader files (typically GRUB) |
/dev | Dev files (commonly from udev) |
/etc | System-wide configuration files |
/home | User directories |
/lib | Essential libraries for /bin binaries |
/media | Removable filesystems |
/mnt | Mounted, non-removable filesystems |
/opt | Miscellaneous software |
/proc | The virtual procfs |
/root | Home directory for the root user |
/run | Runtime info, often a tmpfs |
/sbin | Critical binaries needed to start the system (e.g. the Init System) |
/srv | Data served by the system |
/sys | The virtual sysfs |
/tmp | Temporary files. May be a tmpfs |
/usr | Read-only user data (e.g. icons, libraries, non-critical userland binaries) |
/var | Variable files, such as logs, mail and print spools, caches, databases |
In the last few years, there is some talk of consolidation between /bin
-> /usr/bin
and /sbin/
-> /usr/sbin
(and, in some cases, all of them just going to /usr/bin
)
Not all conventions are held fast - e.g. web servers often use /var/www
over /srv
, and miscellaneous software often uses /usr/local
instead of /opt