Fundamentals 17 min read

Master Linux: Understanding Every Directory and Its Purpose

This guide explains the purpose and typical contents of each major Linux directory—from /bin and /sbin for essential binaries to /etc for configuration files, /proc for virtual system information, and /usr, /var, /home for user data and applications—providing a comprehensive overview for system administrators and developers.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master Linux: Understanding Every Directory and Its Purpose

Linux Directory Structure Overview

/bin : Binary executable commands needed for system boot and for regular users.

/sbin : System binaries primarily used by administrators; regular users may execute them when permitted.

/etc : System configuration files, including user databases (/etc/passwd), init scripts (/etc/rc.d), and many service-specific configs.

/root : Home directory of the superuser.

/lib : Shared libraries required by programs in the root filesystem, analogous to Windows DLLs.

/lib/modules : Kernel modules needed for hardware drivers and other core functionality.

/dev : Device special files that provide access to hardware (e.g., /dev/mouse, /dev/null).

/tmp : Temporary files created by running programs; /var/tmp is preferred for larger or longer‑lived temporary data.

/boot : Files used by the boot loader, such as the kernel image and boot configuration.

/mnt : Temporary mount points for attaching other filesystems.

/proc : Virtual filesystem exposing kernel and process information (e.g., /proc/cpuinfo, /proc/meminfo, /proc/uptime).

/usr : Largest hierarchy containing most user‑level applications, libraries, manuals, and source code. Key subdirectories include:

/usr/bin – standard user commands

/usr/sbin – system administration commands

/usr/lib – shared libraries

/usr/include – C header files

/usr/share, /usr/doc, /usr/man – documentation and shared data

/usr/local – locally installed software, mirroring the /usr layout

/usr/src – source code, including the Linux kernel source

/var : Variable data that changes during system operation, such as logs (/var/log), spool directories (/var/spool), lock files (/var/lock), and temporary files (/var/tmp).

/home : User home directories where personal data and configuration reside.

The root filesystem should remain small, containing only essential files needed for boot and recovery. Larger, frequently changing directories are placed under /usr, /var, or /home to allow separate mounting and easier management.

Additional directories like /opt host large third‑party applications, while /usr/local is used for software installed manually outside the package manager.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxDirectory StructureUnixSystem AdministrationFilesystem
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.