,

Exploring the Linux Filesystem Layout

Have you ever wondered what lies beneath the root directory (/) in a Linux filesystem? In this article, we’ll take a closer look at the main directories that are typically found under the root directory and understand their purposes. Don’t worry if you’re new to Linux; we’ll explain everything in simple terms.
  1. /bin: This directory contains essential executable programs that are crucial for the system to function, even in single user mode.
  2. /boot: Here, you’ll find important files needed to boot the system, such as the kernel, boot configuration files, and bootloader programs.
  3. /dev: It houses special files called “device nodes” that allow interaction with hardware and software devices connected to the system.
  4. /etc: This directory stores system-wide configuration files that control various aspects of the operating system and installed applications.
  5. /home: Each user on the system has a personal directory here, commonly referred to as the “home directory.” It holds user-specific settings, files, and other personal data.
  6. /lib: Essential libraries required by executable programs in /bin and /sbin are stored in this directory.
  7. /lib64: On systems that support both 32-bit and 64-bit programs, this directory contains 64-bit libraries required by executables in /bin and /sbin.
  8. /media: When you insert removable media like CDs, DVDs, or USB sticks, this directory serves as the mount point for accessing their contents.
  9. /mnt: Temporary mount points for additional filesystems can be found here.
  10. /opt: It’s an optional directory for installing additional application software packages.
  11. /proc: This virtual pseudo-filesystem provides information about the system and running processes. It can also be used to adjust system parameters.
  12. /run: Information about the system since the last boot is stored here. This data is cleared upon every reboot.
  13. /sys: Similar to /proc, this virtual pseudo-filesystem provides system and process information. It is often used to alter system parameters and is part of the Unified Device Model.
  14. /root: The home directory for the root user, often referred to as the superuser or system administrator.
  15. /sbin: It contains essential system binaries necessary for system administration tasks.
  16. /srv: This directory is seldom used but can be utilized for storing site-specific data served by the system.
  17. /tmp: Temporary files are stored here, typically deleted across a reboot. In some cases, this directory may be stored in memory (ramdisk).
  18. /usr: It houses multi-user applications, utilities, and data. In theory, this directory is read-only.
  19. /var: This directory stores variable data that changes during system operation, such as log files, mailboxes, and system spool directories.

Understanding these main directories is essential for Linux users and system administrators. During system boot, the system relies on specific directories like /bin, /sbin, /etc, /lib, and /root to function in single user mode. The contents of the /boot directory are vital for the initial booting process.

Underneath /usr and /var, you’ll find additional subdirectories that are worth exploring. These subdirectories contain non-essential binaries, libraries, source code, configuration files, and more.

Now that you have a basic understanding of these directories, you can navigate through the Linux filesystem with confidence and gain a better understanding of your system’s organization and structure.

Disclaimer: The exact layout of these directories may vary slightly across different Linux distributions. However, the general concept and purpose remain the same.