Add the YouTube embed URL for this lesson in components/linux/LinuxLessons.js.
Understanding the Linux File Hierarchy Structure
In Linux, the root directory / is the top-level directory of the operating system. Every file, directory, partition and mounted filesystem exists somewhere under this root directory.
Linux follows a standard structure called the File Hierarchy Structure (FHS), which organizes files into predictable locations so administrators and applications can easily locate system resources.
Core filesystem concepts
Root filesystem
Everything in Linux starts from the root directory /. All filesystems and directories branch from this location.
Configuration & services
Directories like /etc, /var and /run contain important system configuration and runtime service data.
System resources
Directories such as /proc, /sys and /dev expose hardware, kernel and process-related information.
Exploring important Linux directories
The following examples show the most important directories you will work with as a Linux administrator.
1. View top-level directories
Use ls on the root filesystem to explore the Linux File Hierarchy Structure (FHS).
terminal — bash
linux-lab
[root@localhost /]# ls
afs boot etc lib media opt root sbin sys usr
bin dev home lib64 mnt proc run srv tmp var
2. Inspect user home directories
The /home directory stores personal directories for normal users.
terminal — bash
linux-lab
[root@localhost /]# ls /home
devuser opsuser student
[root@localhost /]# ls -ld /home/devuser
drwx------ 2 devuser devuser 4096 Jan 12 10:20 /home/devuser
3. Inspect configuration files
The /etc directory contains important system-wide configuration files.
terminal — bash
linux-lab
[root@localhost /]# ls /etc | head
adjtime
aliases
bashrc
crontab
fstab
group
hostname
hosts
4. Explore the /proc virtual filesystem
The /proc filesystem provides live kernel and process information.
terminal — bash
linux-lab
[root@localhost /]# ls /proc | head
1
10
100
101
acpi
buddyinfo
cmdline
cpuinfo
[root@localhost /]# cat /proc/cpuinfo | head
5. Check variable data in /var
The /var directory stores logs, caches and runtime application data.
terminal — bash
linux-lab
[root@localhost /]# ls /var
account cache crash lib local lock log mail opt run spool tmp
[root@localhost /]# ls /var/log
boot.log cron dmesg messages secure
6. Use temporary storage
The /tmp directory is used for temporary files created by users and applications.
terminal — bash
linux-lab
[root@localhost /]# cd /tmp
[root@localhost /tmp]# touch testfile
[root@localhost /tmp]# ls
testfile
Important Linux directories and their purpose
/ (Root Directory)
Top-level directory of Linux.
All filesystems and directories exist under root (/).
Acts as the parent of the entire Linux filesystem.
/root and /home
/root is the home directory for the root user.
/home stores home directories for normal users.
Each user normally has a dedicated subdirectory under /home.
/boot and /etc
/boot stores kernel and bootloader files.
/etc contains system-wide configuration files.
Administrators frequently work with files inside /etc.
/bin and /sbin
/bin stores essential user commands.
/sbin contains system administration binaries.
These commands are required for boot and recovery operations.
/usr
/usr contains user applications and libraries.
/usr/bin stores user binaries.
/usr/sbin stores administrative binaries.
/lib and /lib64
Contain shared libraries required by system binaries.
/lib64 stores libraries for 64-bit systems.
Critical for application execution.
/var and /tmp
/var stores changing data like logs and mail.
/tmp stores temporary files.
Log analysis often involves /var/log.
/proc and /sys
Virtual filesystems managed by the kernel.
/proc provides process and CPU information.
/sys exposes hardware and kernel data.
/dev
Contains device files for hardware components.
Represents disks, terminals and other devices.
Linux treats devices as files.
/opt, /srv, /mnt and /media
/opt is used for optional third-party software.
/srv stores service-related data.
/mnt and /media are used for mounted filesystems and removable media.
Important administrator notes
systemd and PID 1
In modern Linux distributions like RHEL 7+, systemd runs as PID 1 and manages system services and boot operations.
Virtual filesystems
Directories like /proc and /sys are generated dynamically by the kernel and do not physically exist on disk.
Practice tasks for your Linux lab
Run ls / and identify every top-level directory.
Explore /etc, /var/log and /home to understand their contents.
Use cat /proc/cpuinfo and cat /proc/meminfo to inspect live system information.
Create temporary files inside /tmp and remove them safely.
Practice navigating between directories using cd, pwd and ls.
In the next lesson, you will learn Linux file permissions, ownership and access control mechanisms in detail.