Master Linux File System: What Every Directory Means and How to Use Them
This guide walks you through the Linux file system hierarchy, explaining the purpose of each top‑level directory—from /bin and /sbin to /home and hidden config folders—so you can navigate, modify, and troubleshoot your system with confidence.
/bin and /sbin
bin(Binary) stores executable files and shortcuts such as cp, chmod, and cat. These are regular user commands. sbin (System Binary) holds utilities that affect system configuration and typically require sudo or root privileges, like ifconfig and iptables.
/boot
This directory contains files needed for system boot, including the grub bootloader. Modifying files here is generally discouraged.
/dev
dev(device) holds device files that represent hardware components as files, e.g., sda and sdb for hard‑disk partitions. All hardware appears as files under this directory.
/etc
Configuration files for the system and installed packages reside here. For example, /etc/apt stores APT repository lists, and most program‑specific settings are found under sub‑directories of /etc.
/lib, /lib32, /lib64
libcontains shared libraries required by binaries in /bin and /sbin. Architecture‑specific variants ( lib32, lib64) hold libraries for 32‑bit or 64‑bit binaries.
/media and /mnt
/mediaautomatically mounts removable devices (USB drives, external disks) under a sub‑folder named after the user (e.g., /media/fdl). /mnt is intended for manual mounts, though modern systems often handle mounting automatically.
/opt
Optional third‑party software is placed here. Users often install manually downloaded applications (e.g., Chrome, music players, IDEs) in /opt.
/proc
proc(process) provides a virtual filesystem exposing runtime information about processes. Each sub‑directory named with a PID contains files describing that process, and the directory also offers system details such as CPU status and kernel version.
/root
The superuser’s home directory. Access requires root privileges.
/run and /sys
These directories store runtime data and kernel‑exposed system information. Files here reside in memory and disappear after a reboot; they should not be used for persistent storage.
sudo vim /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness/srv
Intended for service data. Empty on desktop installations but used on servers to hold web or FTP service files.
/tmp
Temporary files created by applications. Contents are cleared on reboot, though occasional manual cleanup may be needed.
/usr and /usr/local
usr(Universal System Resource) holds user‑installed applications and libraries. Sub‑directories /usr/bin and /usr/sbin contain executables, while /usr/local mirrors this hierarchy for locally compiled software.
/var
Historically “variable”, now primarily stores log files (e.g., /var/log) and other mutable data. Logs accumulate over time and may need periodic cleanup.
/home
User home directories contain personal files, downloads, and hidden configuration folders (e.g., .config, .cache, .local). Hidden folders beginning with a dot store per‑application settings and user‑specific binaries such as ~/.local/bin.
Final Summary
To modify system configuration, edit files under /etc. User‑specific settings reside in hidden files within the home directory. Executable commands are typically found in /bin, /sbin, /usr/bin, /usr/sbin, and their /local equivalents. Logs are under /var/log, temporary files under /tmp, and device files under /dev (auto‑mounted to /media).
/bin
/sbin
/usr/bin
/usr/sbin
/usr/local/bin
/usr/local/sbin
/home/USER/.local/bin
/home/USER/.local/sbinIf you write a script and want it globally accessible, place it in one of the directories above.
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.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
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.
