Linux, just like to other operating systems based on Unix, arranges its files and folders in a hierarchical system starting with the root directory (/).
It is crucial to understand this layout for efficiently navigating, controlling, and fixing issues in a Linux system.
The structure of the Linux file system is designed in a similar way to an upside-down tree, where the top is the root directory (/). All other directories stem from this root.
Below are the following are the main directories commonly used in Linux, their functions, and the contents typically found in each. Main Directories in the Linux File System

Root Directory (/) #
- The root directory serves as the top level in the Linux hierarchy from which all files and directories originate.
- Only system administrators (root users) have complete access to this directory.
- It houses important subdirectories containing system files, configurations, and binaries.
/bin – Necessary User Binaries #
- This directory stores vital command binaries needed for system operations and maintenance.
- Essential utilities such as ls, cp, mv, cat, and echo are found here.
- Since it contains fundamental commands, all users can access this directory.
/boot – Boot Loader Files #
- The /boot directory contains files essential to the booting process, including the Linux kernel, initrd files, and the boot loader like GRUB.
- Modifying files in this directory requires caution as it is critical for system booting.
/dev – Device Files #
- Device files representing hardware devices like disks, terminals, and USB devices are located in this directory.
- These are special files providing interfaces to hardware, not typical files.
- Examples include /dev/sda for disk drives and /dev/tty for terminals.
/etc – System Configuration Files #
- This directory holds system-wide configuration files and shell scripts for setting up system settings.
- Files like passwd, fstab, and hosts can be found here, along with subdirectories for individual application configurations.
- System administrators heavily rely on this directory for controlling system settings and behavior.
/home – User Home Directories #
- User home directories are stored here, each user having their subdirectory (e.g., /home/user1, /home/user2).
- It houses user-specific files, preferences, and configurations.
- Ordinary users can read and write to their directories but cannot access others’ by default.
/lib and /lib64 – Key Shared Libraries #
- Essential shared libraries needed by binaries in /bin and /sbin are stored here.
- /lib libraries are similar to DLL files on Windows and are crucial for system functioning.
- In some systems, a /lib64 directory may contain 64-bit libraries based on architecture.
/media – Removable Media #
- This directory is used as a mount point for removable media like USB drives, CDs, and DVDs.
- When a USB drive is connected, it may be automatically mounted in /media for easy access.
/mnt – Temporary Mount Points #
- This directory is often utilized for temporarily mounting filesystems.
- Administrators can mount additional filesystems here as needed, such as network drives or external storage.
/opt – Optional Application Software #
- For installing third-party applications and software packages not managed by the default package manager.
- Applications in /opt may include additional software packages or vendor-specific software.
/proc – Process and Kernel Information #
- A virtual file system offering details about running processes and kernel parameters.
- Each running process has directories and files (e.g., /proc/1234 for process ID 1234).
- Files are dynamically created and updated by the kernel, providing valuable data for monitoring and debugging.
/root – Root User Home Directory #
- The home directory for the root user (administrator), positioned directly under the root (/) directory for emergency access.
/run – Runtime Variable Data #
- Has transient data related to system operations post last boot, like process IDs, sockets, and runtime information.
- Typically, this directory is cleared upon system reboot.
/sbin – System Binaries #
- Contains core binaries for system administration tasks, mainly utilized by the root user.
- Commands such as ifconfig, reboot, and mkfs are included here and are not in regular users’ default paths.
/srv – Service Data #
- Data for services provided by the system, such as web and FTP servers, are kept in this directory.
- For example, a web server may have its data in /srv/www.
/tmp – Temporary Files #
- Accessible to all users, this directory is meant for temporary files that are usually deleted upon reboot.
- Ideal for storing transient data.
/usr – User Binaries and Immutable Data #
- Stores user applications and utilities, categorized into subdirectories like /usr/bin, /usr/lib, and /usr/share.
- /usr/local houses locally installed software while /usr/share contains architecture-independent data like documentation and icons.
/var – Variable Data Files #
- Contains files that tend to increase in size, namely logs, caches, and temporary files generated by applications.
- Important directories within /var include /var/log for logs, /var/spool for scheduled jobs, and /var/tmp for temporary files.
- These directories are crucial for monitoring both application and system logs.
Appreciating the Significance of Each Directory #
- Linux’s organized file structure ensures logical locations for files, aiding in maintaining system efficiency. System Binaries: Important commands and tools are divided into /bin and /sbin directories for easy access.
- Configuration Files: All configuration files are kept in /etc, simplifying the process for system administrators to manage settings.
- User Data: By storing user directories in /home, it ensures that user files are kept separate from system files.
- Variable Data: Data that changes frequently is organized in /var, making it simpler to monitor logs, caches, and temporary files.
- Familiarity with this system layout assists users in finding files, resolving problems, and keeping a well-organized server environment.
Author’s Final Word #
While Linux’s file system may seem complicated at first, it is designed to improve system management, security, and reliability.
Becoming familiar with each directory will help you navigate and control your system more effectively. Understanding where to find what you need can help save time and simplify your tasks, whether you are installing software, adjusting settings, or reviewing logs.