
In Linux, everything is organized in a structured and logical way. Unlike some operating systems where files are scattered across drives, Linux follows a single-root hierarchical file system. Every file, directory, device, and process is part of one unified tree.
Understanding this structure is essential for:
System administration
DevOps and cloud operations
Server management
Troubleshooting
Software development
Security and permissions
When you clearly understand where things live in Linux, managing the system becomes simple and predictable.
Linux starts with a single top-level directory called:
/
This is known as the Root Directory. Everything in Linux grows from this root like branches of a tree.
There are no separate drives like C:, D:, or E:. Even external storage, USB drives, and network storage are mounted somewhere inside this tree.
Let us explore the most important directories in Linux one by one.
The root directory is the top of the file system. Every other directory exists under it.
It contains essential system folders required for booting and operating the system.
You normally do not store personal files here.
The /bin directory contains basic commands required for system operation and user tasks.
Examples:
ls → list files
cp → copy files
mv → move files
rm → remove files
cat → view file content
pwd → show current directory
These commands are required even when the system is in minimal mode.
This directory contains commands mainly used by system administrators.
Examples:
reboot
shutdown
fsck (file system check)
mount
iptables
These are essential for system control and maintenance.
/etc contains configuration files for the entire system.
Examples:
Network configuration
User account settings
System startup configuration
Service configuration
Common files:
/etc/passwd → user information
/etc/shadow → encrypted passwords
/etc/hosts → hostname mapping
/etc/fstab → file system mount settings
This directory is critical for system behavior.
Each user has a personal directory under /home.
Example:
/home/user1
/home/user2
This directory contains:
Personal files
Documents
Downloads
User configurations
Desktop data
Normal users mostly work inside /home.
This is the home directory for the root (administrator) user.
It is separate from /home for security and system control.
Only root user has full access here.
/usr contains most installed applications and libraries.
Subdirectories:
/usr/bin → User programs
/usr/sbin → Admin programs
/usr/lib → Libraries
/usr/share → Shared files
Most software installed using package managers goes here.
This directory contains data that changes frequently.
Examples:
Log files → /var/log
Mail data → /var/mail
Cache → /var/cache
Spool → /var/spool
When debugging system issues, logs inside /var/log are very important.
Temporary files created by programs are stored here.
Files may be deleted automatically
Used by applications for temporary processing
Not meant for permanent storage
In Linux, hardware devices are represented as files.
Examples:
/dev/sda → Hard disk
/dev/tty → Terminal
/dev/null → Null device
/dev/usb → USB device
This design allows Linux to treat devices like regular files.
/proc is a virtual file system. It does not store real files.
It contains runtime system information such as:
Running processes
CPU usage
Memory usage
Kernel parameters
Example:
/proc/cpuinfo → CPU details
/proc/meminfo → Memory status
System monitoring tools use this directory.
Another virtual file system used for hardware and kernel interaction.
Used by system tools to manage:
Devices
Drivers
Kernel modules
Contains files required to start the system.
Examples:
Kernel image
Boot loader (GRUB)
Initramfs
If this directory is damaged, system may not boot.
These contain essential shared libraries used by system programs and kernel modules.
Programs depend on these libraries to run.
Third-party software and custom applications are often installed here.
Example:
Commercial tools
External packages
Used to mount external storage like:
USB drives
External disks
Network drives
/media is usually for automatic mounting, /mnt for manual mounting.
Stores temporary runtime data such as:
Process IDs
System state
Service information
Cleared on reboot.
Let us understand with a simple example.
When you open a program:
Command is executed from /bin or /usr/bin
Program loads libraries from /lib or /usr/lib
Reads configuration from /etc
Stores logs in /var/log
Uses /tmp for temporary data
Kernel interacts via /proc and /sys
Every directory has a specific purpose.
Benefits:
Organized structure
Predictable system behavior
Easy troubleshooting
Secure permission model
Efficient system management
This structure is defined by FHS (Filesystem Hierarchy Standard).
Every file in Linux has:
Owner
Group
Permissions (read, write, execute)
Permissions control access and security across the file system.
It is the structured organization of directories starting from root (/) where every file and system component resides.
Root (/) is the top-level directory from which all other directories originate.
User files are stored inside /home.
It stores system configuration files.
Logs, cache, mail, and variable system data.
A virtual file system containing process and system runtime information.
Contains device files representing hardware components.
Stores files required to start the Linux system.
Temporary files created by applications.
It helps manage system organization, security, troubleshooting, and server administration.
The Linux File System Hierarchy is simple once understood. Every directory has a clear purpose, and the entire system works in a structured and logical way.
When you know where files live and how Linux organizes its data, system administration, DevOps, and development become much easier and more predictable.
Mastering the Linux file system is a foundational skill for anyone working with Linux-based environments.
To master Linux file system hierarchy and administration with comprehensive training, consider enrolling in our specialized Linux Training program. For those looking to become complete DevOps professionals, we also offer comprehensive DevOps Training that includes Linux fundamentals along with modern DevOps tools and practices.