Linux File Hierarchy Structure (original) (raw)

Last Updated : 4 Jun, 2026

The Linux File Hierarchy Structure or the Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Unix-like operating systems. It is maintained by the Linux Foundation.

Linux_File_Hierarchy

1. / (Root)

At the top of every Linux file system is the root directory represented by a forward slash /. It’s the base point, and no directory exists above it.

root-linux-directory

root-linux-directory

2. /bin

The /bin directory contains essential commands and binaries needed by all users, including cp, ls, ssh, and kill. These commands are universally available across user types.

bin-linux-directory

bin-linux-directory

3. /boot

This directory stores all files required for booting the system. It includes the GRUB bootloader configuration and essential kernel files that are loaded during startup.

boot-linux-directory

boot-linux-directory

4. /dev

Device files in Linux are stored in the /dev directory. These are special files that act as interfaces between hardware and software. Device files are of two types: block devices (e.g., hard drives) and character devices (e.g., microphones and speakers). Examples include /dev/sda1 for disk partitions.

dev-linux-directory

dev-linux-directory

5. /etc

Short for "Editable Text Configuration," /etc contains configuration files for system applications, users, services, and tools or it contains the Host-specific system-wide configuration files. For example, user details like UID and local addresses are defined here.

etc-linux-directory

etc-linux-directory

6. /home

Every non-root user has a personal directory inside /home. For example, if your username is anshu, your personal directory would be /home/anshu. Each user can create, delete, or modify files only in their own home directory and access of another user's home depends on security configuration.

home-linux-directory

home-linux-directory

home-linux-directory

home-linux-directory

7. /lib

Applications require shared libraries to run, which are stored in /lib. These include dynamic libraries needed during runtime. For example, Apache server libraries are available here.

lib-linux-directory

lib-linux-directory

8. /media

Devices like USBs, CDs, and pen drives are mounted under /media. For example, when a CD-ROM is inserted (appeared in FHS-2.3), its details will appear here.

media-linux-directory

media-linux-directory

9. /mnt

When external drives are connected, they are temporarily mounted in /mnt. This is where their contents become accessible to the system.

mnt-linux-directory

mnt-linux-directory

10. /opt

Third-party software and packages not part of the default system installation are stored in /opt. It includes their configuration and data files.

opt-linux-directory

opt-linux-directory.

11. /sbin

This directory holds administrative binaries like iptables, firewall management tools, fsck, init, route etc. These binaries are primarily for system administrators and typically require root privileges to execute.

sbin-linux-directory

12. /srv

Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.

srv-linux-directory

srv-linux-directory

13. /tmp

Programs create temporary files during execution, and these are stored in /tmp. These files are deleted automatically after the program finishes or when the system is restarted.

tmp-linux-directory

tmp-linux-directory

14. /usr

Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.

15. /proc

The /proc directory provides detailed information about system processes. Each process is assigned a unique ID and represented as a directory inside /proc. For example, /proc/meminfo gives real-time data about memory usage including total, free, buffer, and cache statistics.