Linux File System Hunting

Learning web development in public. Writing simple, real-world explanations about web development concepts. Helping beginners understand why things work, not just how.
When I first started using Linux, it felt very simple.
Type a command → press enter → get output.
But during this assignment, my thinking changed.
Instead of asking:
“What command should I run?”
I started asking:
“What is actually happening inside the system when I run this?”
That small shift completely changed how I understand Linux.
Linux is Not a Black Box
Earlier, I treated Linux like a black box.
Now I see it differently.
Linux does not hide things. It exposes almost everything through files.
Processes, networking, users, hardware, system behavior — everything is visible if you know where to look.
/etc — Where System Rules Live
At first, /etc looked like a random directory.
But when I explored it:
cat /etc/hosts
cat /etc/resolv.conf
cat /etc/passwd
I realized something important:
/etc is where Linux stores its rules.
Examples:
/etc/hostsmaps domains to IP addresses/etc/resolv.confdefines DNS servers/etc/passwdstores user information
These are not passive files.
They are actively used by the system.
If you change them, system behavior changes.
So Linux is not fixed. It is configurable.
DNS — What Happens When You Open a Website
When you type a domain like google.com, the system needs an IP address.
Flow:
System reads
/etc/resolv.confContacts DNS server
Gets IP address
Starts connection
Important observation:
If DNS is misconfigured:
Internet appears broken
But the issue is only name resolution
Many network problems are actually DNS problems.
Routing — How Data Finds Its Path
After getting an IP, the system must decide where to send data.
This is handled by routing.
cat /proc/net/route
Routing table defines:
destination
gateway
interface
Flow:
Application sends request
Kernel checks routing table
Kernel decides path
Applications do not control routing. The kernel does.
/proc — Live System Data
This was the most interesting part.
echo $$
ls /proc/$$
cat /proc/meminfo
cat /proc/cpuinfo
At first, /proc looks like a normal directory.
But it is not.
It is created dynamically by the kernel.
There are no real files stored on disk.
What it provides:
Real-time system information
Process-specific data
Instant updates
When you read /proc, you are reading live kernel data.
/dev — Hardware as Files
In Linux, hardware is also represented as files.
ls /dev
echo "hello" > /dev/null
Examples:
disks
input devices
system devices
Special case:
/dev/nulldiscards all data written to it
Linux follows one core idea:
Everything is treated as a file.
This simplifies how the system interacts with hardware.
Users — Simple and Transparent
cat /etc/passwd
This file contains:
username
user ID
home directory
Passwords are stored separately in /etc/shadow.
Linux stores user data in structured files instead of hiding it.
Permissions — Built-in Security
ls -l file.txt
chmod 000 file.txt
cat file.txt
Result: access denied.
Reason:
The kernel checks permissions before allowing access.
Commands do not enforce security. The kernel does.
Services — Background System Operations
systemctl status
ls /etc/systemd
Observations:
Services run in the background
They start automatically
They are controlled through configuration
Linux systems are structured. Nothing runs randomly.
Boot Process — Where Everything Starts
ls /boot
Contains:
kernel
bootloader files
Boot flow:
Bootloader loads kernel
Kernel initializes system
Services start
This is the starting point of the system.
Final Understanding
Everything connects like this:
Command → Kernel → File System → Hardware
Each part has a role:
/etccontrols behavior/procshows system state/devconnects hardware/var/logrecords activity
Conclusion
Earlier:
Linux = commands
Now:
Linux = a transparent, structured system
The key realization:
Linux does not hide complexity.
It organizes it in a way that can be explored and understood.
Once you understand this structure, Linux becomes logical and much easier to work with.




