Progress: 0/62 (0%)

📂 File System Hierarchy Overview

Linux File System Hierarchy Overview

In Linux, everything is a file — literally everything. Your documents? ✅ Files. Your keyboard? ✅ File. Even your running programs? ✅ Represented as files. All files and folders live inside a single tree-like structure, starting from the root directory /. No drives like C: or D: in Windows — just one big connected tree.

Real-life Analogy

Think of your Linux system like a tree:

  • The root ( / ) → the trunk — the base of everything.
  • All other folders → branches that grow from it.
  • Each branch (like /home, /etc, /bin) → has a special purpose.
  • Everything → connects back to /, the root.

Root Directory (/)

This is the top-most directory — the starting point of the entire file system. It's like the main folder that contains every other folder.

Path example: /home/master/Documents — Here, / is the root, and everything else branches from it.

Key Directories Under /

Directory Meaning / Purpose Example Use
/bin "Binary" — contains essential user commands (like ls, cp, cat, mkdir) When you type a command, Linux finds it here.
/sbin "System Binaries" — for system admin tools (like reboot, shutdown) Used by root (administrator) for system tasks.
/etc Configuration files for system and software Network configs, user settings, startup scripts
/home Home folders for each user /home/master stores your personal files
/root Home directory for the root (admin) user Like "Administrator" in Windows
/lib Libraries needed by system programs Works like .dll files in Windows
/usr "User" programs, apps, and documentation /usr/bin has extra commands
/var "Variable" data — logs, mail, temp files /var/log stores system logs
/tmp Temporary files — cleared often Apps store short-term data here
/boot Bootloader files — needed to start Linux Contains vmlinuz, grub configs
/dev Device files (USBs, hard drives, keyboard, etc.) /dev/sda = first hard drive
/media Mount point for removable drives (USB, DVD) /media/master/pendrive
/mnt Temporary mount point for external drives Used by sysadmins for mounting disks
/opt Optional software packages Manually installed apps may go here
/proc Virtual directory showing system processes /proc/cpuinfo, /proc/meminfo
/sys Information about system hardware Used by kernel to interact with devices

Visual View of the File Tree

📌 Example:
/
├── bin
├── boot
├── dev
├── etc
├── home
│   ├── master
│   └── otheruser
├── lib
├── media
├── mnt
├── opt
├── proc
├── root
├── sbin
├── tmp
├── usr
└── var

How It Differs from Windows

Linux Windows
Single root / Separate drives (C:, D:)
Uses forward slash / Uses backslash \
Case-sensitive (File ≠ file) Not case-sensitive
Configuration files are plain text Uses Registry

Example: Linux: /home/master/Desktop/file.txt vs Windows: C:\Users\Master\Desktop\file.txt

Practical Tips

  • Use pwd → to see your current directory.
  • Use ls → to list files in a directory.
  • Use cd /home/master → to move between folders.
  • Use cd .. → to go up one level.
  • Use tree → to visualize the folder structure (you may need to install it).
📌 Example:
$ pwd
/home/master/Documents

Summary

Concept Meaning
Everything is a file Devices, programs, and data are all files
Root / The starting point of the file system
Each folder under / Has a specific purpose
No drives Just one file tree
Case-sensitive "File" ≠ "file"

Real-world Application

When you're managing Linux:

  • You'll edit configs → in /etc
  • Store your work → in /home
  • Troubleshoot with logs → in /var/log
  • Install software → in /usr or /opt
  • Mount drives → in /media or /mnt

Once you master this structure, navigating Linux becomes second nature!

Real-life analogy

Think of the Linux file system like a large corporate building:

🏢 / → The main entrance (root directory)
🏢 /home → The residential floors where each employee has their personal office
🏢 /etc → The administrative department with all the company policies and procedures
🏢 /bin → The main tools and equipment room accessible to all employees
🏢 /usr → The departmental offices with specialized tools and resources
🏢 /var → The records and archives room where logs and temporary documents are kept
🏢 /dev → The maintenance and facilities department that manages all physical equipment

Every department connects back to the main entrance — just like every file connects back to the root directory!