Linux File System Structure | Complete Guide to / /home /etc /var
Linux file system hierarchy, root directory, /home, /etc, /var, /bin, /usr, /tmp, FHS
Linux File System Structure
The Linux file system is organized as a single hierarchical tree that starts at the root directory, represented by a forward slash (/). Unlike Windows, which uses drive letters such as C: and D:, Linux mounts everything under a single unified tree. Understanding this structure is fundamental to Linux basics and to working effectively with any Linux distribution.
The Root Directory (/)
The root directory is the top of the entire file system tree. Every file and directory on a Linux system lives somewhere under /. Only the root user has write access to / itself. Think of it as the C: drive equivalent, but with a much more organized and standardized layout.
Key System Directories
The /etc directory contains all system-wide configuration files. When you configure a service like SSH or a web server, the config files live in /etc. The /var directory holds variable data โ files that change frequently during normal operation such as log files in /var/log, mail spools, and database files.
The /bin and /usr/bin directories contain executable binary programs. Core commands like ls, cp, mv, and grep live here. The /sbin and /usr/sbin directories hold binaries intended for system administration, such as fdisk and iptables.
User and Home Directories
The /home directory contains a personal directory for each regular user on the system. If your username is alice, your home directory is /home/alice. The tilde symbol (~) is a shortcut that always refers to your home directory. The root user's home is at /root, not /home/root.
Other Important Directories
The /tmp directory is for temporary files that are cleared on reboot. The /dev directory contains device files representing hardware devices such as disks (/dev/sda) and terminals (/dev/tty). The /boot directory holds the Linux kernel and bootloader files.
The /proc and /sys directories are virtual file systems โ they do not exist on disk but expose kernel and process information as readable files. Commands like cat /proc/cpuinfo read live system data.
