DevOps
Linux
File System Hierarchy

File System Hierarchy (FHS)

Unlike Windows, which uses drive letters (C:, D:, etc.), Linux uses a single hierarchical directory structure starting from the "Root" directory (/).

The Directory Tree

The Linux file system is organized like an upside-down tree.

Exhaustive Directory Reference

DirectoryFull NamePrimary Purpose
/binBinariesEssential command binaries for all users (e.g., ls, cp).
/sbinSystem BinariesEssential system binaries reserved for the admin (e.g., fdisk).
/etcEditable Text ConfigurationSystem-wide configuration files (e.g., /etc/passwd).
/libLibrariesShared libraries required by binaries in /bin and /sbin.
/homeHomePersonal directories for regular users.
/rootRoot HomeThe home directory for the superuser (admin).
/devDevicesSpecial files representing hardware devices.
/varVariable DataData that changes frequently, like logs (/var/log).
/tmpTemporaryTemporary files, often cleared on every reboot.
/usrUser UtilitiesSecondary hierarchy for user-specific tools and libraries.
/optOptionalWhere third-party software packages are installed.
/procProcessesVirtual file system providing info about running processes.
/mntMountTemporary mount points for external file systems.
/mediaMediaMount points for removable media (CD-ROMs, USBs).
/bootBootStatic files required to boot the system.
/sysSystemVirtual file system for hardware and kernel information.

[!IMPORTANT] "Everything is a file" In Linux, even hardware devices and running processes are presented to the user as files within this hierarchy. This unified approach is what makes Linux so flexible for automation.