Linux File System
DevOps engineer sharing daily learnings on Linux, Docker, Kubernetes, CI/CD, and Cloud.
The Linux file system is a hierarchical structure that starts from a single root directory /. Unlike Windows (which uses drives like C: or D:), Linux uses one unified directory tree.
/
βββ bin
βββ boot
βββ dev
βββ etc
βββ home
βββ lib
βββ proc
βββ root
βββ sbin
βββ tmp
βββ usr
βββ var
This structure follows the Filesystem Hierarchy Standard (FHS).
Root Directory /
The starting point of the entire Linux file system
All other directories are mounted under
/You cannot delete or rename it
π Think of / as the foundation of Linux
Important Linux Directories Explanation :
- π
/binβ Essential User Binaries :
Contains basic commands used by all users
Available even in single-user mode
Examples :
ls, cp, mv, rm, cat, echo
- π
/sbinβ System Binaries :
Contains commands mainly used by the root user
Used for system administration
Examples :
ip, reboot, shutdown, fsck
- π
/etcβ Configuration Files :
Stores system-wide configuration files
No binaries here
Examples:
/etc/passwdβ User information/etc/hostsβ Hostname mappings
π Editing files here directly impacts system behavior
π
/homeβ User Home Directories :Each user gets a personal directory
Non-root users store their data here
Examples :
/home/apurv
/home/devops
π This is where user-level work happens
- π
/rootβ Root Userβs Home :
Home directory for the root user
Different from
/home
π Keeps admin data isolated from regular users
π
/varβ Variable Data :- Stores files that grow over time
Common subdirectories:
/var/logβ System logs/var/libβ Application state data/var/spoolβ Mail, cron jobs
π Logs are stored here for troubleshooting
- π
/tmpβ Temporary Files :
Used for short-lived files
Often cleared on reboot
π Anyone can write here, so permissions matter
- π
/usrβ User System Resources :
Contains user applications and libraries
Not user-specific despite the name
Important paths:
/usr/binβ User commands/usr/sbinβ Admin commands/usr/libβ Libraries
π /usr is usually read-only in production systems
- π
/lib&/lib64β Shared Libraries :
Libraries required by binaries in
/binand/sbinEssential for system boot
- π
/devβ Device Files :
Represents hardware devices as files
Examples :
/dev/sda β Hard disk
/dev/null β Discards output
π Devices are accessed like files in Linux
- π
/procβ Process Information :
Virtual file system
Contains runtime system information
Helps in debugging & performance analysis
Used by monitoring tools like:
top
ps
htop
π
/bootβ Boot Loader FilesContains kernel and boot-related files
Critical for system startup
π Conclusion
Understanding the Linux file system is non-negotiable for anyone working with Linux.
It forms the base for:
Commands
Permissions
Troubleshooting
Automation