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.
- /bin: This directory contains essential executable programs that are crucial for the system to function, even in single user mode.
- /boot: Here, you’ll find important files needed to boot the system, such as the kernel, boot configuration files, and bootloader programs.
- /dev: It houses special files called “device nodes” that allow interaction with hardware and software devices connected to the system.
- /etc: This directory stores system-wide configuration files that control various aspects of the operating system and installed applications.
- /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.
- /lib: Essential libraries required by executable programs in /bin and /sbin are stored in this directory.
- /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.
- /media: When you insert removable media like CDs, DVDs, or USB sticks, this directory serves as the mount point for accessing their contents.
- /mnt: Temporary mount points for additional filesystems can be found here.
- /opt: It’s an optional directory for installing additional application software packages.
- /proc: This virtual pseudo-filesystem provides information about the system and running processes. It can also be used to adjust system parameters.
- /run: Information about the system since the last boot is stored here. This data is cleared upon every reboot.
- /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.
- /root: The home directory for the root user, often referred to as the superuser or system administrator.
- /sbin: It contains essential system binaries necessary for system administration tasks.
- /srv: This directory is seldom used but can be utilized for storing site-specific data served by the system.
- /tmp: Temporary files are stored here, typically deleted across a reboot. In some cases, this directory may be stored in memory (ramdisk).
- /usr: It houses multi-user applications, utilities, and data. In theory, this directory is read-only.
- /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.