Linux organizes system data and programs using a hierarchical tree-like file system. All directories originate from the root / and branch into specialized folders. Learning the purpose of each directory helps users manage configurations, locate files, and understand how Linux operates beneath the surface.
Main Directories in Linux
/ – Root Directory
The starting point of the entire Linux file system hierarchy. Every other directory branches from here.
/bin – Essential Programs
Contains critical executable files needed during boot and for basic system functionality (e.g., ls, cat).
/boot – Kernel and Bootloader
Stores boot-related files including the Linux kernel (vmlinuz) and bootloader configurations (e.g., GRUB).
/dev – Device Files
Linux treats hardware as files. This directory contains device nodes representing disks, input devices, etc.
/etc – System Configuration
Home to global configuration files and startup scripts. Notable files:
/etc/passwd– User account info/etc/fstab– Disk mount points/etc/crontab– Scheduled tasks
/home – User Directories
Contains personal directories for each non-root user. Files are stored at /home/username.
/lib – Shared Libraries
Holds library files required by binaries in /bin and /sbin. Comparable to DLLs in Windows.
/media – Auto-mounted External Devices
Temporary mount point for devices like USB drives, DVDs, automatically managed by the system.
/mnt – Manual Mounting
Traditionally used for manually mounting additional storage (e.g., mount /dev/sdb1 /mnt).
/opt – Optional Software
Used for installing third-party or proprietary applications outside the standard Linux package system.
/proc – Kernel Info
A virtual directory that exposes real-time kernel and process data, used by tools like top or ps.
/root – Root User’s Home
Dedicated home directory for the root (admin) user. Isolates root from normal users in /home.
/sbin – System Binaries
Includes administrative tools like shutdown, init, fsck. Often restricted to root access.
/tmp – Temporary Files
Used for temporary file storage. Many systems clear /tmp automatically on reboot.
/usr – User Programs
Typically the largest directory. Contains applications and resources for regular use:
/usr/bin– Main executables/usr/lib– Shared libraries/usr/share– Icons, docs, locale files
/var – Variable Data
Stores changing files like system logs, mail spools, databases, and cached content.
/var/log – Log Files
Inside /var, this directory contains log files for debugging and auditing system activity.
Conclusion
Linux structures its file system for maximum clarity and stability. Each directory has a specific purpose, whether it’s storing user data, system binaries, or dynamic content. Familiarity with these directories equips administrators and users to troubleshoot, configure, and interact with the system more effectively.