Linux file system hierarchy

Rangika Kavishka
3 min readJul 19, 2023

--

The Linux file system hierarchy is a structured organization of directories and files used in Linux-based operating systems. It defines the locations where various types of data, configuration files, executables, libraries, and other resources are stored. Understanding the file system hierarchy is essential for effectively managing and navigating a Linux system. Here’s an overview of the primary directories in the Linux file system hierarchy:

1. / (Root Directory): The root directory is the top-level directory in the Linux file system hierarchy. Everything in the file system is located under this directory.

2. /bin: The “/bin” directory contains essential executable binaries (commands) that are available to all users on the system. These binaries are crucial for basic system functionality and do not require administrative privileges to execute.

3. /boot: The “/boot” directory contains files related to the system boot process, such as the Linux kernel, initial RAM disk (initrd), and boot loader configuration files.

4. /dev: The “/dev” directory contains device files representing physical or virtual devices on the system, such as disk drives, printers, and input devices.

5. /etc: The “/etc” directory contains system-wide configuration files. These files control various aspects of the operating system and installed applications.

6. /home: This directory contains user home directories. Each user on the system gets a separate subdirectory within “/home” to store their personal files, configuration settings, and user-specific data.

7. /lib: The “/lib” directory contains shared libraries required by executables in “/bin” and “/sbin.”

8. /media: The “/media” directory is used to mount removable media, such as USB drives and optical discs.

9. /mnt: The “/mnt” directory is used as a temporary mount point for file systems.

10. /opt: The “/opt” directory is used for installing additional software packages from third-party vendors. It keeps the software and their associated files in separate subdirectories to avoid conflicts with system packages.

11. /proc: The “/proc” directory is a virtual file system that provides information about the current state of the kernel and running processes. It is not a regular disk-based file system.

12. /root: This directory is the home directory of the root user, the system administrator. Unlike other user home directories located in “/home,” “/root” is a separate directory to maintain system security.

13. /run: The “/run” directory holds system runtime data. It typically includes files representing system services and processes.

14. /sbin: Similar to “/bin,” the “/sbin” directory contains essential system binaries. However, the executables in “/sbin” typically require administrative (root) privileges to run.

15. /srv: The “/srv” directory is used to store data for services provided by the system.

16. /sys: The “/sys” directory is another virtual file system that exposes information about the kernel and devices.

17. /tmp: The “/tmp” directory holds temporary files that are typically cleared on system reboot.

18. /usr: This directory contains user-readable data and programs, including user-installed software and documentation.

19. /var: The “/var” directory is used to store variable data that changes frequently during system operation. It includes log files, spool directories, and temporary files.

This is a basic overview of the Linux file system hierarchy, and it may vary slightly between different distributions. Understanding these directories and their purposes is crucial for efficiently managing a Linux system and its resources.

--

--

Rangika Kavishka
Rangika Kavishka

Written by Rangika Kavishka

I'm a Content creator that creating IT related content. I'm passionate for Linux, Cyber Security, Ethical Hacking, IoT, Networking and etc.

No responses yet