Skip to main content

Command Palette

Search for a command to run...

Linux File System Hunting: How I Explored What’s Really Happening Inside Linux

Updated
6 min read
Linux File System Hunting: How I Explored What’s Really Happening Inside Linux
A

i am learner whatever i will learn i will write here

When we start using Linux, it usually feels very simple. We type a command, press enter, and get the result. But during this assignment, I stopped thinking about what command to run and started thinking about something deeper:

What is actually happening inside the system when I run this command?

That small change in thinking completely changed my understanding of Linux.

Instead of treating Linux like a black box, I started exploring its file system like an investigator. What I found was surprising Linux does not hide anything. It exposes almost everything through files. Networking, processes, users, hardware, even internal system behavior everything is visible if you know where to look.


/etc — Where the System Learns How to Behave

While exploring different directories, /etc quickly became the most important one. At first, it looked like a random collection of files, but after opening and reading them, I realized something important:

/etc is where Linux stores its rules.

When I checked:

cat /etc/hosts
cat /etc/resolv.conf
cat /etc/passwd

I saw that:

  • /etc/hosts manually maps domain names to IP addresses

  • /etc/resolv.conf tells the system which DNS server to use

  • /etc/passwd stores user information

These are not just files sitting there. These files are actively used by the system and programs every time something runs.

Why this exists:

Instead of hardcoding system behavior into programs, Linux uses configuration files. This makes the system flexible.

Real understanding:

If I change something inside /etc, I am not just editing a file — I am changing how the system behaves.

This made me realize:

Linux is not fixed — it is controlled through configuration.


DNS — The Hidden Step Behind Every Website

When we open a website, we type something like google.com. But computers don’t understand names — they understand IP addresses.

This conversion is handled by DNS.

When I checked:

cat /etc/resolv.conf
ping google.com

I found that the system first reads /etc/resolv.conf to know which DNS server to contact.

What happens internally:

  1. You type google.com

  2. System checks DNS server

  3. DNS returns IP address

  4. Connection starts

Important observation:

If DNS is wrong:

  • Internet will look broken

  • But actually, only name resolution is failing

Insight:

Many network issues are not network problems — they are DNS problems.


Routing — How Linux Decides Where Data Goes

After DNS gives an IP address, the next question is:

How does the system know where to send the data?

That’s where routing comes in.

When I checked:

cat /proc/net/route

I saw routing rules that define:

  • destination network

  • gateway

  • interface

What this means:

Whenever data is sent:

  • Kernel checks routing table

  • Decides path

  • Sends data accordingly

Important point:

Applications don’t control this. The kernel does.

Insight:

Networking decisions in Linux are made by the kernel using routing tables.


/proc — The Most Powerful Discovery

The most interesting part of my exploration was /proc.

At first, it looked like a normal directory, but when I explored it:

echo $$
ls /proc/$$
cat /proc/meminfo
cat /proc/cpuinfo

I realized something shocking:

/proc is not a real folder.

It is created by the kernel in real time.

What I observed:

  • Every process has its own directory

  • System information updates instantly

  • No actual files stored on disk

Why it exists:

To expose internal system data without special tools.

Real understanding:

When I open a file in /proc, I am not reading disk data —

I am reading live kernel data.

Insight:

/proc is like a live window into the system’s brain.


/dev — When Hardware Becomes a File

One concept that completely changed my understanding was /dev.

When I ran:

ls /dev
echo "hello" > /dev/null

I saw that:

  • disks

  • keyboards

  • system devices

all exist as files.

Special example:

/dev/null — anything written to it disappears.

Why this exists:

Linux treats everything as a file so that all interactions become simple.

Real understanding:

Instead of creating different systems for different hardware, Linux uses one simple idea:

Everything is accessed like a file.

Insight:

Hardware is not special in Linux — it is just another file interface.


Users — How Linux Identifies You

User management in Linux is simple but powerful.

cat /etc/passwd

What I saw:

  • username

  • user ID

  • home directory

Passwords are stored separately in /etc/shadow for security.

Why it exists:

To manage multiple users safely.

Real understanding:

Linux does not hide user data — it stores it in structured files.

Insight:

User management in Linux is transparent and file-based.


Permissions — Security Built Into the System

Security in Linux is handled through permissions.

ls -l file.txt
chmod 000 file.txt
cat file.txt

What happened:

Access was denied.

Why:

Kernel checks permissions before allowing access.

Real understanding:

Commands don’t decide access — kernel does.

Insight:

Security in Linux is enforced at the system level, not application level.


Services — How Linux Runs in the Background

Linux systems run many background services.

systemctl status
ls /etc/systemd

What I observed:

  • Services start automatically

  • Controlled by configuration files

Why it exists:

To manage system tasks efficiently.

Real understanding:

Every service is defined, controlled, and predictable.

Insight:

Linux systems are organized — nothing runs randomly.


Boot System — Where Everything Starts

The /boot directory contains files required to start Linux.

ls /boot

What I found:

  • kernel

  • bootloader files

What happens during boot:

  1. Bootloader loads kernel

  2. Kernel starts system

  3. Services begin

Insight:

/boot is the starting point of the entire system.


Final Understanding : How Everything Connects

After exploring all these parts, I finally understood the full flow:

Command → Kernel → File System → Hardware

Each part has a role:

  • /etc → controls behavior

  • /proc → shows system state

  • /dev → connects hardware

  • /var/log → records activity


Conclusion

This exploration completely changed how I see Linux.

Before:
Linux = commands

Now:
Linux = a transparent system where everything is visible and connected

The most important thing I learned is:

Linux does not hide complexity — it organizes it in a way that you can explore and understand it.

And once you understand this structure, Linux becomes much easier, logical, and powerful to use.

N

Great bro , very good article , very helpful 👍

A

Thanks bro 🙌 Glad you found it helpful!

More from this blog

W

WEB DEV COHORT 2K26

24 posts

I share easy-to-understand blogs on JavaScript, Backend Development, and DSA.

From basics to real-world concepts — everything explained simply 🚀