Unlocking Linux: What Every Directory in the File System Means
This guide explains the purpose and typical contents of each standard Linux directory—from /bin and /sbin for system binaries, through configuration files in /etc, device nodes in /dev, to variable data in /var and virtual information in /proc—providing a comprehensive overview of the Linux filesystem hierarchy.
/bin directory
The /bin directory holds essential binary executables needed for system boot and for ordinary users; these are binary (binary‑) files that form the core command set.
/sbin directory
The /sbin directory is similar to /bin but primarily contains administrative binaries used by the system administrator; regular users may run them when permitted.
/etc directory
/etc stores system configuration files, such as /etc/passwd (user database), /etc/rc or /etc/rc.d (startup scripts), /etc/fdprm (floppy parameters), /etc/fstab (filesystem mount table), /etc/group (group definitions), /etc/inittab (init configuration), /etc/issue (login banner), /etc/magic (file type definitions), /etc/motd (message of the day), /etc/mtab (currently mounted filesystems), /etc/shadow (shadow passwords), /etc/login.defs (login defaults), /etc/printcap (printer capabilities), /etc/profile, /etc/csh.login, /etc/csh.cshrc (global shell environments), /etc/securetty (secure terminals), /etc/shells (allowed shells), and /etc/termcap (terminal capabilities).
/root directory
/root is the home directory of the superuser (root).
/lib directory
/lib contains shared libraries needed by programs in the root filesystem, allowing code reuse and reducing executable size.
/lib/modules directory
/lib/modules holds loadable kernel modules, especially those required for system recovery such as network and filesystem drivers.
/dev directory
/dev provides device files that represent hardware devices. Important entries include:
/dev/console – system console.
/dev/hd* – IDE hard‑disk partitions (e.g., /dev/hda, /dev/hda1).
/dev/sd* – SCSI disk partitions (e.g., /dev/sda).
/dev/fd* – floppy devices (e.g., /dev/fd0).
/dev/st* – SCSI tape devices.
/dev/tty* – virtual consoles (e.g., /dev/tty1).
/dev/pty* – pseudo‑terminals for remote logins.
/dev/ttys* – serial ports (e.g., /dev/ttyS0).
/dev/cua* – serial communication devices.
/dev/null – null device that discards all written data.
/tmp directory
/tmp stores temporary files created by programs during execution; for longer‑lived temporary data, /var/tmp is preferred.
/boot directory
/boot contains the bootloader files and kernel images; large numbers of kernels may be moved to a separate filesystem.
/mnt directory
/mnt is a mount point for temporarily mounting other filesystems, such as /mnt/dos, /mnt/ext, or /mnt/cdrom.
/usr directory
/usr is a large hierarchy for user‑installed applications and data. Key subdirectories include:
/usr/x11R6 – X Window system binaries and files.
/usr/x386 – X11R5 binaries.
/usr/bin – most user commands.
/usr/sbin – system administration commands.
/usr/man, /usr/info, /usr/doc – manual pages, GNU info documents, and other documentation.
/usr/include – C header files.
/usr/lib – shared libraries and some configuration files.
/usr/local – locally installed software and data.
/var directory
/var holds variable data that changes frequently, such as logs, spools, and temporary files. Important subdirectories include:
/var/catman – pre‑formatted manual pages.
/var/lib – state information for packages and services.
/var/local – variable data for locally installed programs.
/var/lock – lock files used to coordinate access to resources.
/var/log – log files for system and application events.
/var/run – runtime information such as /var/run/utmp.
/var/spool – spool directories for mail, print queues, etc.
/var/tmp – larger or longer‑lived temporary files.
/proc filesystem
/proc is a virtual filesystem that provides runtime kernel and process information. Notable entries include:
/proc/cpuinfo – CPU details.
/proc/devices – loaded device drivers.
/proc/dma – DMA channel usage.
/proc/filesystems – supported filesystems.
/proc/interrupts – interrupt usage.
/proc/ioports – I/O port allocation.
/proc/kcore – physical memory image.
/proc/kmsg – kernel messages.
/proc/ksyms – kernel symbol table.
/proc/loadavg – system load averages.
/proc/meminfo – memory usage.
/proc/modules – loaded kernel modules.
/proc/net – network protocol status.
/proc/self – symlink to the calling process's own /proc entry.
/proc/stat – various kernel statistics.
/proc/uptime – system uptime.
/proc/version – kernel version.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
