The Filesystem Hierarchy Standard (FHS)


The Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Linux and other Unix-like operating systems. It establishes a single directory tree for file system structure and dictates where files and programs should reside, ensuring consistency across compliant systems.
Here are some key directories in the FHS:
/ (root): The top-level directory of the file system.
/bin: Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.
/boot: Boot loader files, e.g., kernels, initrd.
/dev: Device files, e.g., /dev/null.
/etc: Host-specific system-wide configuration files.
/home: Users’ home directories, containing saved files, personal settings, etc.
/lib: Essential shared libraries and kernel modules.
/media: Mount points for removable media such as CD-ROMs (superseded by /run/media).
/mnt: Temporarily mounted filesystems.
/opt: Add-on application software packages.
/sbin: System binaries, e.g., fsck, init, route.
/usr: Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
/var: Variable data files; files whose content is expected to continually change during normal operation of the system, such as logs, spool files, and temporary e-mail files.
Root directory of Deepin Linux
The Filesystem Hierarchy Standard (FHS) is maintained by the Linux Foundation. The standards are decided through collaboration with the wider Linux community, including developers, distribution maintainers, and users. The FHS is periodically updated to reflect the needs and consensus of the community. Most mainstream Linux distributions follow the FHS closely, but there may be variations or additional directories specific to each distribution.
Subscribe to my newsletter
Read articles from Elavarasan A directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
