Skip to content

Lesson 03 β€” Linux File System

Unlike Windows, Linux doesn’t use drive letters such as **C:*, **D:*, or **E:**.

Instead, Linux organizes everything into a single hierarchical directory structure that begins at the Root Directory (/).

In Linux:

  • Files
  • Directories
  • Hard disks
  • USB drives
  • Network storage
  • Running processes
  • Devices

are all represented as files within this hierarchy.

Understanding the Linux File System is one of the most important skills for Linux administrators, Cloud Engineers, DevOps Engineers, and Cybersecurity Professionals.

Throughout your Linux career, you’ll constantly work with directories, configuration files, logs, applications, and storageβ€”all of which are organized within the Linux File System.


After completing this lesson, you will be able to:

  • Understand the Linux File System Hierarchy.
  • Navigate Linux directories.
  • Identify important system directories.
  • Understand absolute and relative paths.
  • Explore common file management commands.
  • Understand where Linux stores configuration files, logs, applications, and user data.

A File System defines how an operating system stores, organizes, and retrieves files.

It provides a structured way to organize:

  • Files
  • Directories
  • Storage Devices
  • Permissions
  • Metadata

Without a file system, the operating system would not know where files are stored.


Linux follows the Filesystem Hierarchy Standard (FHS).

Everything begins from a single directory:

/

This is called the Root Directory.

Every other directory exists underneath it.


/
β”œβ”€β”€ bin
β”œβ”€β”€ boot
β”œβ”€β”€ dev
β”œβ”€β”€ etc
β”œβ”€β”€ home
β”œβ”€β”€ lib
β”œβ”€β”€ media
β”œβ”€β”€ mnt
β”œβ”€β”€ opt
β”œβ”€β”€ proc
β”œβ”€β”€ root
β”œβ”€β”€ run
β”œβ”€β”€ sbin
β”œβ”€β”€ srv
β”œβ”€β”€ sys
β”œβ”€β”€ tmp
β”œβ”€β”€ usr
└── var

Understanding these directories is essential for Linux administration.


The Root Directory is the top-level directory in Linux.

Everything starts here.

Example:

/

Think of it as the parent of every directory in the operating system.


The /home directory stores user files.

Example:

/home
β”œβ”€β”€ student
β”œβ”€β”€ alice
└── bob

Each user has their own personal directory.

Typical contents include:

  • Documents
  • Downloads
  • Desktop
  • Pictures
  • Configuration Files

The /root directory is the home directory of the root (administrator) user.

Example:

/root

Do not confuse / with /root.

They are completely different.


The /etc directory stores system configuration files.

Examples:

/etc/passwd
/etc/hosts
/etc/fstab
/etc/ssh/

Most Linux administration tasks involve modifying files in /etc.


Contains essential user commands.

Examples:

ls
cp
mv
cat
pwd

These commands are available even during system recovery.


Contains essential administrative commands.

Examples:

reboot
shutdown
mount
fdisk

Primarily used by system administrators.


Stores applications and user programs.

Example:

/usr/bin
/usr/lib
/usr/share

Most installed software resides here.


Stores data that changes frequently.

Examples:

Logs
Mail
Cache
Databases
Print Queues

One of the most important directories is:

/var/log

System logs are stored here.


Temporary files.

Applications use this directory while running.

Files may be automatically removed after reboot.


Contains files required to start Linux.

Examples:

  • Linux Kernel
  • Boot Loader
  • Initial RAM Disk

Without /boot, Linux cannot start.


Linux treats hardware devices as files.

Examples:

/dev/sda
/dev/sdb
/dev/null
/dev/random

Hard disks, USB devices, and other hardware appear here.


A virtual file system containing information about running processes and the Linux kernel.

Examples:

/proc/cpuinfo
/proc/meminfo
/proc/version

Useful for troubleshooting and system monitoring.


Provides information about hardware devices and kernel settings.

System administrators use this directory for advanced hardware management.


Stores optional third-party applications.

Examples:

/opt/google
/opt/docker
/opt/customapp

Many enterprise applications install files here.


Used when removable media is automatically mounted.

Examples:

  • USB Drives
  • DVDs
  • External Hard Drives

Temporary mount point used by administrators.

Example:

/mnt/backup
/mnt/storage

Commonly used during maintenance.


An Absolute Path begins from the Root Directory.

Example:

/home/student/Documents/file.txt

Absolute paths always begin with:

/

A Relative Path begins from the current directory.

Example:

Documents/file.txt

Relative paths do not begin with /.


Display your current location.

Command:

Terminal window
pwd

Example:

/home/student

Display files and directories.

Command:

Terminal window
ls

Display detailed information.

Terminal window
ls -l

Display hidden files.

Terminal window
ls -la

Move into another directory.

Terminal window
cd /home

Return to your home directory.

Terminal window
cd

Move up one directory.

Terminal window
cd ..

Move to the previous directory.

Terminal window
cd -

Display the contents of a directory.

Example:

Terminal window
ls /etc

Example output:

passwd
hosts
ssh
fstab

Linux hides files beginning with a period.

Examples:

.bashrc
.profile
.gitconfig

Display hidden files:

Terminal window
ls -la

Linux supports several file types.

Type Description
Regular File Standard file
Directory Folder
Symbolic Link Shortcut
Character Device Keyboard, Terminal
Block Device Hard Disk
Socket Network Communication
Named Pipe Process Communication

Cloud virtual machines also use the Linux File System.

Example:

AWS EC2
↓
Ubuntu
↓
/etc
↓
Configuration Files
↓
Application Starts

Cloud administrators regularly manage these directories.


Security professionals investigate:

  • Log Files
  • User Directories
  • SSH Configuration
  • Authentication Logs
  • Malware Files

Common investigation locations:

/var/log
/etc
/home
/tmp

Understanding the Linux File System is critical during incident response.


Display current directory:

Terminal window
pwd

List files:

Terminal window
ls

Change directory:

Terminal window
cd

Display directory tree (if installed):

Terminal window
tree

Display disk usage:

Terminal window
df -h

Display mounted file systems:

Terminal window
mount

These commands are used daily by Linux administrators.


A Cloud Engineer deploys a web server.

Ubuntu Server
↓
/etc/nginx
(Configuration)
/var/log/nginx
(Log Files)
/usr/sbin/nginx
(Application Binary)
/var/www/html
(Website Files)

Knowing the Linux File System makes troubleshooting much easier.


As a Linux administrator:

  • Learn the purpose of each major directory.
  • Keep user data under /home.
  • Avoid modifying system files unnecessarily.
  • Store logs under /var/log.
  • Back up configuration files before making changes.
  • Use absolute paths in automation scripts.
  • Keep temporary files in /tmp.
  • Organize applications consistently.

A well-organized file system simplifies administration and troubleshooting.


After completing this lesson, you should understand:

  • The Linux File System Hierarchy Standard (FHS).
  • The purpose of major Linux directories.
  • Absolute vs relative paths.
  • Basic navigation commands.
  • Common file types.
  • How Linux organizes applications, configuration files, logs, and user data.

The Linux File System provides a standardized and organized way to store and manage files across the operating system.

Unlike Windows, Linux organizes everything beneath a single Root Directory, making navigation consistent across distributions.

Whether you’re managing cloud servers, troubleshooting applications, analyzing security incidents, or automating infrastructure, a solid understanding of the Linux File System is essential.

Mastering the Linux directory structure will make every future administration task easier.


➑️ Lesson 04 β€” Linux Users & Groups

In the next lesson, you’ll learn how Linux manages users and groups, understand authentication and authorization, create user accounts, assign permissions, and explore best practices for identity management in Linux systems.