IH.

Connect

October 6, 2022 · 3 min read

File System Hierarchy for Linux OS

A quick reference describing the general file system hierarchy of a Linux system — what each top-level directory under root is for.

Linux Systems DevOps

⚠️ Note: I couldn’t recover the original publish date for this post from the source page, so pubDate above is a placeholder — swap in the actual date before publishing.

✔️ Describe the general file system hierarchy of a Linux system

Every Linux system is organized as a single tree, starting from one directory: /, the root. All other directories — whether they live on the same disk, a different partition, or removable media — are mounted somewhere underneath this one root, giving Linux a single, unified namespace instead of separate drive letters like Windows.

                          Linux file system
                                  /

   ┌───────┬───────┬───────┬─────┼─────┬───────┬───────┬───────┐
  /bin   /boot   /dev    /etc  /lib  /media  /mnt    /opt    /home

                    ┌─────────┬──┴───┬────────┬───────┬───────┐
                   /root    /proc  /sys     /tmp    /usr     /var

                                                            /srv

                                                            /run

(Diagram: the original reference image for this hierarchy is included alongside this file at assets/linux-file-system-hierarchy.png.)

The Root Directory — /

The top-level directory is the root filesystem, and it contains all of the files required to boot the operating system before any other filesystems are available. After boot (/ root), every other filesystem gets mounted at its standard location underneath it.

The Directories, One by One

DirectoryPurpose
/etcConfiguration files for installed applications.
/binBinaries — contains essential command binaries needed for basic system operation.
/sbinExecutables used for system administration (binary system files).
/bootFiles required to boot the Linux OS, including the kernel executable (static bootloader).
/devDevice files — facilitates access to every hardware device attached to the system.
/libEssential shared libraries and kernel modules.
/usrThe secondary hierarchy — houses the bulk of user-facing programs, libraries, and documentation.
/mntTemporary mount point for regular filesystems.
/mediaMounting point for removable media.
/optOptional files, such as third-party tools.
/tmpTemporary files.
/varVariable data.
/rootThe root user’s home folder.
/homeHome folders for regular users.
/srvData for services provided by the system.
/procVirtual filesystem exposing process and kernel information.
/sysVirtual filesystem exposing hardware and driver information.
/runStorage for runtime information generated since the last boot.

Why This Matters

Once you internalize this layout, a Linux system stops feeling arbitrary. Configuration always lives in /etc, logs and variable data always live under /var, temporary files always land in /tmp, and every user’s personal space sits under /home. That consistency is exactly why the same mental model transfers across distributions — Ubuntu, Fedora, Debian, or anything else — once you know one, you effectively know them all.