Master Linux Directory Structure: From Root to Essential System Paths
This guide explains the Linux filesystem hierarchy, comparing it with Windows, detailing the root‑based tree layout, the historical evolution of Unix directories, the Filesystem Hierarchy Standard, and the most important top‑level directories and configuration files for system administration.
Windows directory examples: C:\windows, D:\Program Files, E:\文档\精品, F:\娱乐\动态图.
Linux directory structure starts from the root "/" and forms a hierarchical, inverted‑tree layout. Unlike Windows, Linux mounts directories on devices, making the tree flexible.
1.1 Basic characteristics of Linux directory structure
All directories begin at the root "/".
The root contains a layered tree structure.
Directories can be mounted on different devices or partitions.
Mount points are ordinary directories.
Logically, every directory (and its sub‑directories) resides under the top‑level "/", unlike Windows which separates trees by drive letters.
2 Unix directory structure history
1969 Ken Thompson and Dennis Ritchie invented Unix on a PDP‑7; in 1971 they upgraded to a PDP‑11.
Early Unix used a tiny RK05 disk (~1.5 MB). As data grew, additional disks were added and mounted at /usr, /home, etc., establishing the hierarchy that persists today.
3 Linux directory hierarchy (FHS)
FHS (Filesystem Hierarchy Standard) defines the purpose of top‑level directories.
First level : Directories directly under "/" such as /etc (configuration), /bin, /sbin, /usr, /var, /home, /proc, /dev, /tmp, /root.
Second level : Sub‑directories under /usr (e.g., /usr/bin, /usr/share) and /var (e.g., /var/log).
3.1 Important top‑level directories
/dev – device files.
/etc – system and service configuration files (e.g., /etc/hosts, /etc/fstab, /etc/rc.local).
/proc – virtual filesystem exposing kernel and process information.
/tmp – temporary files.
/home – ordinary user home directories.
/root – superuser home directory.
/var – variable data like logs (/var/log, /var/spool).
/usr – user programs and data (/usr/bin, /usr/sbin, /usr/local, /usr/share, /usr/src).
/bin and /sbin – essential binaries for all users and for the superuser.
3.2 Common configuration files
/etc/sysconfig/network-scripts/ifcfg-eth0 – network interface configuration (DEVICE, IPADDR, NETMASK, GATEWAY, ONBOOT, etc.).
/etc/resolv.conf – DNS resolver configuration (overridden by interface settings on restart).
/etc/hosts – static hostname‑IP mappings.
/etc/fstab – filesystems to mount at boot.
/etc/rc.local – commands executed at boot.
/etc/inittab – init run‑level definitions.
/etc/init.d – service start/stop scripts.
/etc/sudoers – sudo permissions.
3.3 /var and /proc paths
/var/log – system logs (e.g., /var/log/messages, /var/log/secure).
/var/spool – spool directories for cron, mail, etc.
/proc/cpuinfo, /proc/meminfo – CPU and memory information.
/proc/loadavg – system load average.
/proc/mounts – mounted filesystem information.
3.4 Practical tips
Understanding the hierarchy simplifies navigation, configuration, and troubleshooting on Linux servers.
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.
