Skip to main content

Command Palette

Search for a command to run...

DevOps Journey #2: Understanding the Linux File System

Exploring how Linux organizes files, directories, processes, and devices under a single file-based hierarchy.

Updated
•9 min read•View as Markdown
M
Hi, I'm Mominur Islam. I'm a Scholar Trainee at Wipro and an aspiring Cloud & DevOps Engineer. I created this space to document my learning journey and share what I learn along the way. From Linux fundamentals and Bash scripting to Cloud Computing, AWS, Git, and DevOps practices, you'll find my notes, hands-on experiences, projects, and reflections here. I'm a strong believer in learning by doing and learning in public. Writing about my experiences helps me reinforce my understanding while connecting with others who are on a similar path. Current areas of focus: • Linux • Bash Scripting • Git & GitHub • AWS • DevOps Fundamentals Thanks for stopping by. Let's learn and grow together! 🚀

Introduction

In the previous article, I covered some essential Linux commands that every beginner should know. While revisiting those commands, I realized that understanding Linux commands is only one part of the journey. To become comfortable with Linux, it's equally important to understand how Linux organizes its files and directories.

Although I had previous exposure to Linux through academic projects and personal learning, I never spent much time exploring the Linux File System in depth. As I continue my Cloud and DevOps journey, I decided to revisit this topic because Linux file system knowledge is fundamental to system administration, cloud computing, containers, and DevOps tools.

For this article, I explored the Linux file system hands-on using WSL (Windows Subsystem for Linux), navigating through directories and understanding the purpose behind each one.


Why Understanding the Linux File System Matters

When working with Linux, almost everything revolves around the file system.

Applications are stored as files.

Configuration settings are stored as files.

Logs are stored as files.

Devices are represented as files.

Running processes expose information through files.

This design philosophy makes Linux powerful and flexible because a terminal is often all you need to interact with the operating system.

Understanding the file system helps us:

  • Navigate Linux confidently

  • Troubleshoot issues more effectively

  • Locate configuration files

  • Understand where applications are installed

  • Work comfortably with cloud servers and containers


Linux Is a File-Based Operating System

One statement that completely changed my perspective on Linux was:

Linux is a file-based operating system.

Everything in Linux is organized around files.

This doesn't just mean documents and folders.

In Linux:

  • Commands are files

  • Configuration settings are files

  • Hardware devices are files

  • Running process information is accessible through files

Once I started viewing Linux from this perspective, the terminal felt much less intimidating.

Instead of thinking about Linux as a complex operating system, I started seeing it as a collection of files and directories that can be explored and managed.


Navigating the Linux File System

Before exploring important directories, we need to understand how to move around the file system.

pwd

The pwd command displays the current working directory.

momin@APL-5CG5413W1K:~$ pwd
/home/momin
momin@APL-5CG5413W1K:~$

This helps identify your current location in the filesystem.


ls

The ls command lists files and directories.

momin@APL-5CG5413W1K:~$ ls
name.txt  net  tell
momin@APL-5CG5413W1K:~$

Useful options:

momin@APL-5CG5413W1K:~$ ls -l
total 8
-rw-r--r-- 1 momin momin    0 Oct 11 12:36 name.txt
drwxr-xr-x 3 root  root  4096 Sep 27 12:16 net
drwxrwxr-x 3 momin momin 4096 Sep 27 13:20 tell
momin@APL-5CG5413W1K:~$

Displays a detailed list view.

momin@APL-5CG5413W1K:~$ ls -a
.              .landscape                 .viminfo
..             .lesshst                   name.txt
.bash_history  .local                     net
.bash_logout   .motd_shown                tell
.bashrc        .profile
.cache         .sudo_as_admin_successful
momin@APL-5CG5413W1K:~$

Displays hidden files.

momin@APL-5CG5413W1K:~$ ls -la
total 76
drwxr-x--- 7 momin momin  4096 Oct 11 12:36 .
drwxr-xr-x 5 root  root   4096 Sep 10 14:03 ..
-rw------- 1 momin momin  8494 Oct 11 12:19 .bash_history
-rw-r--r-- 1 momin momin   220 Sep  9 12:14 .bash_logout
-rw-r--r-- 1 momin momin  3771 Sep  9 12:14 .bashrc
drwx------ 2 momin momin  4096 Sep  9 12:15 .cache
drwxr-xr-x 2 momin momin  4096 Sep 10 11:53 .landscape
-rw------- 1 momin momin    43 Sep 24 11:36 .lesshst
drwxr-xr-x 3 momin momin  4096 Sep  9 12:29 .local
-rw-rw-r-- 1 momin momin     0 Oct 11 12:18 .motd_shown
-rw-r--r-- 1 momin momin   807 Sep  9 12:14 .profile
-rw-r--r-- 1 momin momin     0 Sep  9 12:15 .sudo_as_admin_successful
-rw------- 1 momin momin 17081 Sep 27 13:19 .viminfo
-rw-r--r-- 1 momin momin     0 Oct 11 12:36 name.txt
drwxr-xr-x 3 root  root   4096 Sep 27 12:16 net
drwxrwxr-x 3 momin momin  4096 Sep 27 13:20 tell
momin@APL-5CG5413W1K:~$

Displays all files and directories with detailed information.


cd

The cd command is used to change directories.

momin@APL-5CG5413W1K:~$ cd net
momin@APL-5CG5413W1K:~/net$

Move back one directory:

momin@APL-5CG5413W1K:~/net$ cd ..
momin@APL-5CG5413W1K:~$

Return to your home directory:

momin@APL-5CG5413W1K:~/net$ cd ~
momin@APL-5CG5413W1K:~$

These three commands are enough to start exploring most Linux systems.


Understanding the Root Directory (/)

Linux uses a hierarchical structure that looks like an upside-down tree.

At the very top is the root directory:

/

Everything in Linux begins from this location.

If you're familiar with Windows, you can think of it as being somewhat similar to the C: drive.

However, Linux organizes everything under a single root instead of separating resources across multiple drive letters.

All directories branch out from:

/

Important Linux Directories

During my exploration, I found that understanding the purpose of major directories makes Linux much easier to understand.


momin@APL-5CG5413W1K:/$ ls
bin                lost+found          srv
bin.usr-is-merged  media               sys
boot               mnt                 tmp
dev                opt                 usr
etc                proc                var
home               root                wslAbCKDi
init               run                 wslDpKnCi
lib                sbin                wslaCiMAi
lib.usr-is-merged  sbin.usr-is-merged  wslcggDkf
lib64              snap                wslhLdPDi
momin@APL-5CG5413W1K:/$

/bin

The /bin directory contains essential binary executables.

Examples include:

ls
cp
mv
cat

These commands are actually files stored within Linux.

This directory contains many of the basic commands we use every day.


/sbin

The /sbin directory contains system administration binaries.

Examples:

useradd
groupadd

These commands are mainly used for managing and maintaining the operating system.


/usr

The /usr directory stores user-space applications, libraries, documentation, and additional software.

Many applications and resources installed on Linux can be found here.


/etc

The /etc directory contains system-wide configuration files.

Examples include:

  • Network configuration

  • Service configuration

  • Application configuration

Whenever administrators need to modify Linux settings, this directory is usually one of the first places they visit.


/home

The /home directory contains personal directories for regular users.

Example:

/home/mominur

A user's documents, downloads, scripts, and personal files are typically stored here.

This is where I spent most of my time while practicing Linux.


/root

The /root directory is the home directory of the root user.

Unlike normal users stored under /home, the Linux administrator account has its own dedicated directory.


/var

The /var directory stores variable data.

Examples:

  • Logs

  • Cache files

  • Application data

  • Temporary service information

One important location is:

/var/log

This directory contains logs that are extremely useful during troubleshooting.


/tmp

The /tmp directory stores temporary files.

Applications often use this location to store temporary data while they are running.

Files here are generally not intended for long-term storage.


/opt

The /opt directory stores optional third-party applications and software packages.

Many manually installed applications use this location.


/boot

The /boot directory contains files required during the Linux boot process.

These include:

  • Bootloader files

  • Kernel-related files

Since I was working inside WSL, this directory appeared quite different compared to a traditional Linux installation.


/dev

The /dev directory was one of the most interesting discoveries.

It contains device files.

Examples include:

  • Storage devices

  • Memory devices

  • System devices

This directory demonstrates Linux's philosophy that everything can be treated like a file.


/proc

The /proc directory contains information about running processes and the Linux kernel.

Each running process gets its own entry here.

This directory is especially important for:

  • Monitoring

  • Troubleshooting

  • Observability

Many monitoring tools use information exposed through /proc.


/sys

The /sys directory provides information about:

  • Hardware

  • Drivers

  • Kernel subsystems

It offers insight into how Linux interacts with underlying hardware.


/run

The /run directory stores runtime information generated after the system boots.

Examples include:

  • Process IDs (PID files)

  • Runtime service information

  • Sockets


/mnt

The /mnt directory is used for temporarily mounting other file systems.

Examples:

  • Additional disks

  • Network storage

  • External drives


/media

The /media directory is commonly used for removable devices such as:

  • USB drives

  • CD/DVD media


Everything Is a File in Linux

One of the biggest lessons I learned while exploring the Linux file system is that Linux treats almost everything as a file.

Commands are files.

Logs are files.

Configurations are files.

Devices are files.

Process information is available through files.

This design makes Linux extremely powerful because the same tools used to work with ordinary files can often be used to interact with other parts of the system.

The more I explore Linux, the more I appreciate this elegant design.


Key Takeaways

✅ Linux follows a hierarchical file system structure that begins at the root directory (/).

✅ Understanding the file system makes Linux navigation much easier.

✅ Directories such as /home, /etc, /var, and /usr are used daily by administrators and engineers.

✅ Linux follows the philosophy that nearly everything can be represented as a file.

✅ Strong Linux file system knowledge provides a foundation for Cloud Computing and DevOps.


What's Next?

Now that I have a better understanding of how Linux organizes files and directories, the next step is learning is how Linux can manipulate and navigate text.

Next Article,

DevOps Journey #3: Text Manipulation and Navigation in Linux


Conclusion

Revisiting the Linux File System gave me a deeper appreciation for how Linux is designed. What initially appears complex becomes surprisingly logical once you understand the purpose of each directory and the philosophy behind Linux's file-based architecture.

As I continue my DevOps Journey, I'm focusing on strengthening these fundamentals before moving into more advanced topics. Building a strong foundation now will make learning cloud platforms, containers, automation tools, and other DevOps technologies much easier in the future.

Thank you for following along on this journey, and I'll see you in the next article!

DevOps Journey: From Beginner to Cloud & DevOps Engineer

Part 3 of 3

A documented journey of learning Linux, Git, AWS, Docker, Terraform, Kubernetes, and DevOps practices from scratch. Follow along as I share concepts, labs, projects, challenges, and lessons learned.

Start from the beginning

DevOps Journey #0: Why I Started Learning Cloud and DevOps

Documenting my journey from beginner to Cloud and DevOps Engineer through hands-on learning, projects, and continuous improvement.