Course contentsShow
← Linux
Lesson 260 of 1,8193. The Filesystem Hierarchy and POSIX StandardsFree lesson

Root Partition and Directory Structure

Identify the purpose and contents of primary root-level directories according to the FHS.

In this lesson, you will learn how the Linux filesystem organizes its data starting from the root directory to ensure system stability and consistency.

In Linux, everything begins at the root, denoted by a single forward slash (/). Unlike some operating systems that assign drive letters (like C: or D:) to different hardware partitions, Linux uses a unified "tree" structure defined by the Filesystem Hierarchy Standard (FHS). Whether you have one hard drive or ten, they are all mounted somewhere within this single, overarching directory tree.

The root directory (/) serves as the base of the entire system. Directly underneath it are several primary directories, each with a specific purpose:

  • /bin and /usr/bin: Contain the binary executable files for standard system commands (like ls or cp).
  • /etc: Holds the system-wide configuration files. This is where you modify settings for your programs and services.
  • /home: The location where individual user personal files and directories reside (e.g., /home/username).
  • /root: The home directory specifically for the superuser (root). It is kept separate from standard users.
  • /dev: Contains device files, which act as interfaces to physical hardware (like your disk or keyboard).
  • /var: Stores variable data that changes frequently, such as system logs or print queues.
  • /tmp: A directory for temporary files that are usually cleared upon system reboot.

To visualize your current position in this structure, you can use the pwd (print working directory) command. If you type cd / followed by ls, you will see these directories listed as the foundation of your system:

cd /
ls -F
# You will see directories with a trailing slash, such as bin/, etc/, home/, etc.

The beauty of this structure is its predictability. Because the FHS standardizes these paths, a program knows exactly where to look for its configuration files (/etc) and where to write its logs (/var/log), regardless of the specific Linux distribution you are using. This organizational discipline is what allows your shell to manage complex processes, environment variables, and hardware interaction seamlessly from a single point of origin.

Key Takeaway: The root directory (/) is the single entry point for the entire Linux filesystem, organizing all data, hardware, and configuration into a predictable, standardized hierarchy mandated by the FHS.