Linux File System Hierarchy Explained
Linux File System Hierarchy (FSH) defines how Linux organizes default files and directories. It arranges them by features and functions. It automatically creates necessary directories during the installation and places related files there. This tutorial explains Linux FSH, its structure, and the contents of essential top-level directories.
The / (root) directory
The slash (/) directory is the topmost directory in the Linux file system. It is also called the root directory. It is the starting point of the Linux file system. All other directories are directly or indirectly mounted to it. Directories available just under the / directory are called top-level directories. Top-level directories contain the files that provide Linux's default functionality. Some of these directories hold static data, while others contain dynamic information. Static data refers to file content that remains unchanged unless modified explicitly. Dynamic or variable data, in contrast, refers to file content that is modified and updated as required by system processes. Static directories normally contain commands, configuration files, library routines, kernel files, and device files. Dynamic directories contain log, status, and temporary files.
Key points:-
- It is the topmost directory of the Linux file system.
- It is also called the root directory.
- All other directories are directly or indirectly mounted to it.

This tutorial is also available in video format on YouTube.
Linux File System Hierarchy and Structure | Linux Top-Level Directories Explained
The /etc directory
The extended text configuration directory holds system configuration files. It contains the settings that determine how the operating system and various applications behave. It stores centralized system configuration, control, boot, and service files. Since this directory contains files that control the entire system, you need root privileges to create, edit, or update files in this directory. Most files in this directory are standard text files. You can edit them using any standard text editor tools with root privileges.
Key points:-
- It contains configuration and setting files that control system operations and functions.
- You need root privilege to create, update, and manage files in this directory.

The /root directory
This is the default home directory for the root user. The root user is the highest privileged user account. Linux automatically creates this account during the installation. To enhance system security, most distributions keep it disabled by default. If required, you can enable it. The /root directory is the default home directory for it.
Key points:-
- It is the default home directory for the root user.
- You cannot access this directory under the regular user account.
The /home directory
The /home directory provides a default directory for every user account. When you create a new user account with default settings, Linux automatically makes a new directory in this directory. This directory has the same name as the username. For example, if the username is rick, the name of this directory will also be rick unless you manually specify a custom name.
The user gets full permission in this directory. He can save his personal files, configuration files, scripts, and any other data. He can also allow or restrict other users from accessing his files. A user has full permission only for their home directory. He cannot access data saved in another user’s home directory unless the other user or the root user allows him to do so. Most Linux distributions automatically create a few standard directories inside a user’s home directory to organize their files.
Key points:-
- The /home directory is designed to store user home directories and other user content.
- Each user is assigned a home directory for personal files, and can block access to other users.
- A user cannot access other users' directories without special permission.
- Storing personal data in the home directory keeps it separate from the operating system files, preventing accidental damage to the system.

The usr (UNIX System Resources) directory
This directory contains and provides resource files that the system needs for various functions. It organizes files into subdirectories for specific functions. Important subdirectories available in this directory are the following.
/usr/bin
The default /bin has a symbolic link to this directory. It contains general-purpose commands. These commands do not need special privileges. You can run these commands under any user account.
/usr/sbin
The default /sbin has a symbolic link to this directory. It contains commands for system management. These commands require special privileges. You can run these commands only as a root or superuser.
/usr/lib[64]
The library directories contain shared library routines required by many commands and programs located in the /usr/bin and /usr/sbin directories, as well as by the kernel and other applications and programs.
/usr/include
The include directory contains header files for the C language.
/usr/local
The local directory saves commands and tools downloaded from the web, developed in-house, or obtained elsewhere. These commands and tools are not provided or distributed by Linux distributions.
/usr/share
The share directory provides the default location for manual pages, documentation, sample templates, configuration files, etc.
/usr/src
This directory stores source code.

The Variable (/var) directory
This directory stores data that changes frequently during normal system operation. It stores log files, status information, spool files, lock files, and other dynamic data essential to system processes. Important subdirectories available in this directory are the following.
/var/log
This subdirectory stores log files. It saves system logs, boot logs, user logs, failed user logs, installation logs, cron logs, mail logs, and logs for common services running on the system.
/var/opt
This directory saves log, status, and other variable data files for third-party software installed in the /opt directory.
/var/spool
This subdirectory keeps print jobs, cron jobs, mail messages, and other queued items before they are processed by their respective applications.
/var/tmp
This subdirectory holds large temporary files and automatically deletes them if they are not accessed or modified for a period of 30 days. It is different from the top-level temporary directory. The top-level temporary directory keeps temporary data for 10 days, while this directory keeps it for 30 days. Another noticeable difference between the two is that the top-level temporary directory serves as a repository for temporary files. Many programs create temporary files here during runtime or installation. The temporary directory in the Variable directory allows running programs or services to save their temporary data for a longer period.
| /var/tmp | /tmp |
| Hold large temporary files. | Hold smaller files. |
| Automatically delete files after 30 days if they are not accessed or modified. | Automatically delete files after 10 days if they are not accessed or modified. |
| Files stored in this directory survive system reboots. | Files stored in this directory survive system reboots. |
| Applications use this directory to store cached data. This directory serves as a repository for temporary files. | Many programs create temporary files here during runtime or installation. |

The /dev directory
The device directory stores node files for physical and virtual devices. The kernel communicates with these devices through corresponding device node files located in this directory. These device files are automatically created and deleted by the dynamic device management service.
Key points:-
- The device directory stores node files for physical and virtual devices.
- The kernel communicates with these devices through corresponding device node files located in this directory.
- The udevd service automatically creates and deletes device files as needed.
- There are two types of device files: character and block. The kernel accesses devices using one of these files or both.
- The kernel accesses character files through serial communications. Console, serial printers, mice, keyboards, and terminals are examples of character device files.
- Block device files are accessed in a parallel fashion during kernel and device communication. Hard disk drives, optical drives, and parallel printers are examples of block device files.

The /proc (Process File System) directory
This directory maintains information about the current state of the running kernel. It includes details on the current hardware configuration and the status of CPU, memory, disks, partitioning, file systems, networking, running processes, and so on. The contents of this directory are dynamically managed by the system. They are created in memory at system boot time, updated during runtime, and destroyed at system shutdown.
The /run (Runtime File System) directory
This directory stores data for processes running on the system. For example, the media subdirectory under this directory is used to automatically mount external file systems, such as CDs, DVDs, or USB drives.
The /sys (System File) directory
This directory saves virtual information about hardware devices and drivers. This information is used by the kernel to load the necessary device drivers.
The /bin directory
This directory stores essential executable commands and programs. These tools are available to all users in all modes. You can also use them when the system boots or in single-user mode to repair or customize the file system.
Key points:-
- It contains essential commands.
- It is available to all users in all modes.
- To simplify the file structure, in many distributions, this directory is a symbolic link to /usr/bin.

The /sbin directory
The /sbin directory also stores executable commands and programs. However, these tools are available only to the super users.
Key points:-
- It contains privileged commands.
- It is available only to superusers.
- To simplify the file structure, in many distributions, this directory is a symbolic link to /usr/sbin.

The /opt directory
The /opt directory is the default location for third-party software and applications. Unlike standard system programs that split their files across /usr/bin, /usr/lib, and /usr/share, applications in /opt typically keep everything in a single, isolated subdirectory. Since an application's entire footprint is often contained in a single directory, uninstalling is usually as simple as deleting that directory. The /opt/bin directory is not usually in the system’s default $PATH, so you often have to manually add it or create symbolic links in /usr/local/bin to run these programs from the terminal easily.

Conclusion
Understanding the Linux File System Hierarchy is essential for effectively managing, maintaining, and troubleshooting a Linux system. Each directory serves a distinct purpose, from storing user data and system configurations to housing essential executables and device files. By organizing files in a logical and standardized manner, Linux ensures stability, security, and ease of use for both administrators and users. Familiarity with these directories allows you to navigate the system confidently and perform administrative tasks efficiently.
Author Laxmi Goswami Updated on 2026-03-28