Skip to main content

Command Palette

Search for a command to run...

Exploring Linux

Updated
4 min readView as Markdown

Linux can feel incredibly hard and confusing at first. You stare at a empty screen, or a black terminal, and it feels like the operating system is a locked vault hiding all its secrets from you.

But for a recent project, I decided to stop blindly typing commands and actually start snooping around the root directory (/). . It turns out, Linux isn’t hiding anything at all. It actually keeps its diary wide open on the desk; you just have to know which pages to read.

Here are some of the things I discovered when I went inside the root directory.

/proc

My first stop was the /proc directory. I expected to find standard files here, but I immediately found something strange: almost every file claimed to be exactly zero bytes in size. Yet, when I opened them, they were full of text!

It turns out, /proc is basically an illusion. It doesn't actually exist on the hard drive. It’s a "pseudo-filesystem" generated in real-time by the system's RAM.

Peeking at processes

Every running app gets a numbered folder here (its Process ID). Opening a file like /proc/1234/cmdline shows the exact command that started that process.

Talking to hardware

Files like /proc/cpuinfo act as a direct connection to the hardware. Reading it is just a plain-text way of asking the computer, "Hey, what kind of processor are you running?"

The Takeaway

It felt like looking at the Matrix. You don't need a fancy, heavy dashboard app to see what your computer is thinking. The system’s actual brain waves are just written out as text files.

/etc

If /proc is the brain, /etc is the rulebook. This directory holds the configuration files that dictate how the system behaves.

I got so amazed after finding out how Linux finds its way around the internet, when I went digging for networking files and found the system's address books:

/etc/hosts

I discovered that before a Linux machine ever asks the internet where "google.com" is, it checks this local file first. It made me realize how easily a malicious edit here could hijack someone's web browsing without them ever knowing.

/etc/resolv.conf

This tiny little file is the system's map to the internet. It literally just holds the IP addresses of the DNS servers the computer is allowed to ask for directions.

The Takeaway

I love how transparent this is. In windows, these settings are basically hidden from the users in the deep network of registries. In Linux, if the internet stops working, you literally just open a text file to see who it's trying to talk to.

/var/log

Every good debugger needs a log file, so my next stop was /var/log. This is where the system and all its applications stores exactly what they’ve been up to.

/var/log/auth.log

This was the most exciting find. It records every single attempt to log into the system. Browsing through it, I could see the exact timestamps of successful logins, but more wildly, I could see failed attempts from automated bots out on the internet trying to guess passwords and break in!

/var/log/syslog

This is the general dumping ground where the kernel drops status updates, minor complaints, and crash reports.

The Takeaway

Logs are the ultimate source of truth. It was deeply satisfying to realize that when things break or look suspicious, there is no guesswork. The system already wrote down exactly what happened.

/dev

My final stop was /dev, which is where Linux gets wonderfully weird. This directory takes the famous "everything is a file" philosophy to the extreme by treating physical hardware like ordinary text files.

I found entries in here representing my actual hard drive (sda) and my terminal window (tty). I got to know that if you know what you are doing, you can bypass the normal filesystem completely and just dump raw data straight into the /dev/sda file.

The famous /dev/null

The system's digital black hole. Anything you send to this file is instantly deleted forever. It’s incredibly useful for silencing annoying error messages!

Conclusion

Final Thoughts Exploring Linux under the hood made me realize that it isn't magic; it's just incredibly organized geography. By keeping its hardware interfaces, running thoughts, and rules laid out as readable files, Linux hands you the keys to the kingdom. You just have to be curious enough to open the files.