USD ($)
$
United States Dollar
Euro Member Countries
India Rupee

File System Hierarchy and Directory Structure

Lesson 8/49 | Study Time: 20 Min

The Linux file system hierarchy is a logical and standardized structure that organizes all files and directories within a single unified directory tree. This structure, defined by the Filesystem Hierarchy Standard (FHS), ensures consistency and predictability across different Linux distributions. 

Understanding the Root Directory

At the very top of the Linux file system is the root directory, denoted by a single forward slash /. All files and directories branch off from this root, regardless of their actual physical location on disk or partitions. There are no "drive letters" as in Windows; everything in Linux exists within this one tree structure.

Major Top-Level Directories and Their Purposes

Each main directory under / plays a specific role. The table below summarizes the most important ones:

Key Features and Practical Uses

Each major Linux directory is designed for a specific operational purpose. Below are essential directories and their practical applications.


1. /etc: Critical for holding configuration files; for example, /etc/passwd holds user accounts, /etc/network/interfaces manages network setup.

2. /var: Used for files that can change in size (log files, emails, print jobs) and can grow substantially over time.

3. /home: Each user has a private workspace—great for separating user data from system files.

4. /proc and /sys: Pseudo-files; essential for administrators to monitor and configure kernel parameters and processes in real time.

Examples of Directory Structure

text
/
├── bin/
├── boot/
├── dev/
├── etc/
│ └── passwd
├── home/
│ ├── user1/
│ └── user2/
├── lib/
├── media/
├── opt/
├── proc/
├── root/
├── run/
├── sbin/
├── srv/
├── sys/
├── tmp/
├── usr/
└── var/

Notes on Navigation and Permissions


1. Only the root user can make system-level changes outside /home or /tmp.

2. Mounting new storage devices temporarily uses /mnt or /media, not inside /home.

3. /bin and /sbin contain only essential programs needed for booting or repairing the system.

4. Files in /tmp may be deleted between reboots; never store important data there.

Filesystem Hierarchy Standard (FHS)

The FHS is a widely accepted convention that all major Linux distributions follow. It ensures programs and administrators know where system files, binaries, configurations, and user data are located for consistency and ease of use.

Samuel Wilson

Samuel Wilson

Product Designer
Profile

Class Sessions

1- What is Linux and Operating System Concepts 2- Linux History and Evolution 3- Linux Distributions and Their Purposes 4- Open Source Software and Licensing 5- Graphical User Interface (GUI) and Desktop Environments 6- Terminal Access and Command-Line Fundamentals 7- Getting Help and Command Documentation 8- File System Hierarchy and Directory Structure 9- Navigating Directories and Listing Contents 10- Creating, Copying, and Moving Files and Directories 11- Deleting Files and Directories 12- Symbolic and Hard Links 13- Understanding File Permissions Model 14- Modifying Permissions and Ownership 15- User and Group Management 16- Sudo and Privilege Escalation 17- Text Searching and Pattern Matching 18- Text Processing and Stream Editing 19- Compressing and Archiving Files 20- Text Editing and File Creation 21- Package Management Systems Overview 22- Installing and Updating Software with APT 23- Installing and Updating Software with YUM/DNF 24- Managing Software from Non-Repository Sources 25- Understanding Processes and Process Management 26- Viewing Running Processes 27- Process Control and Termination 28- Task Scheduling with Cron 29- Networking Concepts and IP Addressing 30- Viewing and Configuring Network Interfaces 31- Basic Network Troubleshooting 32- Shell Script Basics 33- Variables and Data Types 34- Conditional Logic in Scripts 35- Loops and Iteration 36- Functions and Code Reuse 37- Input/Output and User Interaction 38- System Authentication and Access Control 39- File System Security 40- Software Updates and Patching 41- Basic Firewall Concepts 42- System Information and Monitoring 43- Service and Daemon Management 44- System Boot Process and Runlevels 45- System Backup and Disaster Recovery 46- Comprehensive File System Management 47- System Automation Workflows 48- Multi-Concept Troubleshooting Scenarios 49- Continued Learning Pathways