<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged linux-commands</title>
<link>https://coderlegion.com/tag/linux-commands</link>
<description>Powered by Question2Answer</description>
<item>
<title>Linux Fundamentals for DevOps: Filesystem</title>
<link>https://coderlegion.com/16003/linux-fundamentals-for-devops-filesystem</link>
<description>&lt;p&gt;When you SSH into a server to fix a broken application or install a new tool, the absolute worst thing you can do is guess where files belong. Linux does not put files in random places; it follows a strict, predictable map.&lt;/p&gt;
&lt;p&gt;Understanding this map means you know exactly where to look when an application crashes, when a disk fills up, or when you need to configure a container.&lt;/p&gt;
&lt;p&gt;If you run &lt;code&gt;ls /&lt;/code&gt; on your server, you'll see a massive wall of folders.&lt;/p&gt;
&lt;p&gt;As a DevOps engineer, you don't need to memorize every single one. Here are the crucial directories you will &lt;em&gt;actually&lt;/em&gt; use, what they do, and the proof of why you should care about them.&lt;/p&gt;
&lt;h4 id=&quot;-etc-the-control-room-configurations-&quot;&gt;&lt;code&gt;/etc&lt;/code&gt; — The Control Room (Configurations)&lt;/h4&gt;
&lt;p&gt;You need to change the port your web server listens on, block a user from SSHing into the server, or configure a systemd service.&lt;/p&gt;
&lt;p&gt;Historically, &lt;code&gt;/etc&lt;/code&gt; stood for &quot;et cetera,&quot; but today it is best understood as &lt;strong&gt;Editable Text Configurations&lt;/strong&gt;. Every server, daemon, and background service stores its settings here.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Real scenario: Change the port Nginx listens on&lt;/strong&gt;&lt;br&gt;
Your app is running on port 80 but you need it on 8080 for a staging environment.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# Step 1: Find the config
cat /etc/nginx/nginx.conf

# Step 2: Edit it
nano /etc/nginx/nginx.conf
# Change: listen 80  →  listen 8080

# Step 3: Reload (no downtime!)
systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;-var-the-growing-data-hub&quot;&gt;&lt;code&gt;/var&lt;/code&gt; — The Growing Data Hub&lt;/h4&gt;
&lt;p&gt;This directory stands for &quot;&lt;strong&gt;variable&lt;/strong&gt;.&quot; It is designed to hold data that actively grows and changes while the system is running. If your server suddenly triggers a &quot;Disk Space 100%&quot; alert, &lt;code&gt;/var&lt;/code&gt; is almost always the culprit.&lt;/p&gt;
&lt;p&gt;We split this into two critical sub-directories:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/var/log&lt;/code&gt; &lt;strong&gt;(System and Application Logs):&lt;/strong&gt; Your web application returned a 500 Error, or a database failed to start. This is the very first place you check.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# Watch errors as they happen, live
tail -f /var/log/nginx/error.log

# Search last 100 lines for &quot;error&quot; keyword
tail -n 100 /var/log/syslog | grep -i error

# See how much log data has accumulated
du -sh /var/log/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;/var/lib&lt;/code&gt; &lt;strong&gt;(State Information and Databases):&lt;/strong&gt; This is where applications save their actual heavy data. It is where PostgreSQL stores its database files, and where Docker stores its images and containers.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# &quot;Why is my disk 80% full after installing Docker?&quot;
du -sh /var/lib/docker

# Prune unused Docker images to reclaim space
docker system prune -a

# Where PostgreSQL stores its actual database files
ls /var/lib/postgresql/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; On modern Linux (Ubuntu 20.04+, Debian 10+), &lt;code&gt;/lib&lt;/code&gt; is not a real directory anymore. You can see &lt;code&gt;/lib&lt;/code&gt; and &lt;code&gt;/usr/lib&lt;/code&gt; has common files&lt;/p&gt;
&lt;h4 id=&quot;-home-and-root-user-territories&quot;&gt;&lt;code&gt;/home&lt;/code&gt; and &lt;code&gt;/root&lt;/code&gt; — User Territories&lt;/h4&gt;
&lt;p&gt;You need to grant a new developer SSH access to a server, or you need to authenticate your server to pull code from a private Git repository.&lt;/p&gt;
&lt;p&gt;These directories hold user-specific files. &lt;code&gt;/home&lt;/code&gt; contains folders for standard users (e.g., &lt;code&gt;/home/saeed&lt;/code&gt;), while &lt;code&gt;/root&lt;/code&gt; is the isolated home directory for the superuser.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The DevOps importance:&lt;/strong&gt; configuration files starting with a dot that control how tools behave per-user. Your &lt;code&gt;.bashrc&lt;/code&gt; (shell settings), &lt;code&gt;.kube/config&lt;/code&gt; (Kubernetes cluster access credentials), and &lt;code&gt;.ssh/&lt;/code&gt; (SSH keys) are all stored here.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# Grant a new developer SSH access
# They send you their public key. You do this:
cat dev-alice-key.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys

# Verify it was added
tail -n 3 ~/.ssh/authorized_keys

# Alice can now SSH in — no password needed
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;-proc-the-matrix-a-window-into-the-kernel-&quot;&gt;&lt;code&gt;/proc&lt;/code&gt; — The Matrix (A Window Into the Kernel)&lt;/h4&gt;
&lt;p&gt;You are running a Docker container and need to know exactly how much memory the kernel is allowing it to use, or you need to see the exact environment variables a running process received. Every running process gets a numbered folder here (its Process ID, or PID) containing its live runtime data.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/proc&lt;/code&gt; The files aren't stored on disk — they don't exist until you read them. It is a &quot;&lt;strong&gt;virtual filesystem&lt;/strong&gt;&quot; created in memory by the Linux kernel. . The moment you open &lt;code&gt;/proc/1234/status&lt;/code&gt;, the kernel generates the content on the fly. It's a live feed into what's actually happening right now.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# Find the PID of your container's main process
docker inspect --format='{{.State.Pid}}' my-container

# See every env variable it received at startup
cat /proc/1234/environ | tr '\0' '\n'

# See what files/sockets it has open right now
ls -la /proc/1234/fd

# See exact memory usage the kernel is tracking
cat /proc/1234/status | grep VmRSS

# How long has this server been running?
cat /proc/uptime

# CPU info — useful in CI/CD pipelines
cat /proc/cpuinfo | grep &quot;model name&quot; | head -1

# Current memory usage
cat /proc/meminfo
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;-dev-everything-is-a-file&quot;&gt;&lt;code&gt;/dev&lt;/code&gt; — Everything is a File&lt;/h4&gt;
&lt;p&gt;Linux's philosophy is: &lt;strong&gt;&lt;em&gt;&quot;if it can be read from or written to, it's a file.&quot;&lt;/em&gt;&lt;/strong&gt; Your hard drive? A file. A USB drive? A file. Even &lt;em&gt;nothingness&lt;/em&gt; and &lt;em&gt;randomness&lt;/em&gt; are files. /dev is where all these hardware-and-virtual devices live as file objects. Your hard drives show up here (like &lt;code&gt;/dev/sda&lt;/code&gt; or &lt;code&gt;/dev/nvme0n1&lt;/code&gt;). But it also holds special virtual devices that are incredibly useful for scripting.&lt;/p&gt;
&lt;p&gt;You are writing a cron job and want to completely hide its output so it doesn't spam your logs, or you are attaching a new block storage volume to your cloud instance.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;#/dev/null — The Black Hole                                                                                                                                                                                                                                                                                                                                                        
# This cron job spams your mail. Make it silent:
# The &quot;2&amp;gt;&amp;amp;1&quot; part also redirects error output to null

./noisy-backup-script.sh &amp;gt; /dev/null 2&amp;gt;&amp;amp;1

# Useful breakdown:
#   &amp;gt;           redirects stdout
#   /dev/null   the black hole
#   2&amp;gt;&amp;amp;1        also send stderr to wherever stdout goes
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;-usr-the-real-home-of-installed-software&quot;&gt;&lt;code&gt;/usr&lt;/code&gt; — The Real Home of Installed Software&lt;/h4&gt;
&lt;p&gt;You downloaded a pre-compiled binary (like &lt;code&gt;terraform&lt;/code&gt; or &lt;code&gt;helm&lt;/code&gt;) and want to install it so that anyone on the server can use it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/usr&lt;/code&gt; (&lt;strong&gt;Unix System Resources&lt;/strong&gt;) is where the vast majority of your installed applications, libraries, and tools actually live.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The DevOps importance:&lt;/strong&gt; When you manually download and install a binary, you should place it in &lt;code&gt;/usr/local/bin&lt;/code&gt;. This specific folder is meant for tools managed by the system administrator, ensuring they don't get overwritten when the system package manager (like &lt;code&gt;apt&lt;/code&gt; or &lt;code&gt;yum&lt;/code&gt;) runs its automated updates.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# Move a downloaded binary to the standard location for user-installed tools
mv terraform /usr/local/bin/terraform
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;-opt-third-party-add-ons&quot;&gt;&lt;code&gt;/opt&lt;/code&gt; — Third-Party Add-ons&lt;/h4&gt;
&lt;p&gt;You are installing a heavy monitoring agent like Datadog, or a proprietary vendor application.&lt;/p&gt;
&lt;p&gt;Linux reserves &lt;code&gt;/opt&lt;/code&gt; (&lt;strong&gt;Optional software&lt;/strong&gt;) for self-contained, third-party applications. Instead of scattering files across &lt;code&gt;/usr&lt;/code&gt; and &lt;code&gt;/etc&lt;/code&gt;, these monolithic tools keep everything neatly sandboxed inside their own dedicated folder here.&lt;/p&gt;
&lt;h4 id=&quot;-tmp-the-throwaway-folder&quot;&gt;&lt;code&gt;/tmp&lt;/code&gt; — The Throwaway Folder&lt;/h4&gt;
&lt;p&gt;You need to download a zip file, extract a shell script, run it, and never think about it again.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;/tmp&lt;/code&gt; directory is for temporary files. It is completely wiped clean every time the server reboots, so you should never put persistent or important data here. It also usually has open write permissions, making it the perfect staging ground for quick tasks.&lt;/p&gt;
&lt;h4 id=&quot;blog-summary&quot;&gt;Blog Summary&lt;/h4&gt;
&lt;p&gt;This guide breaks down the essential directories every DevOps engineer needs to know—like &lt;code&gt;/etc&lt;/code&gt; for configurations, &lt;code&gt;/var&lt;/code&gt; for logs, and &lt;code&gt;/proc&lt;/code&gt; for live system processes. Complete with real-world use cases and simulated terminal outputs, this post serves as a practical map for quickly troubleshooting crashes, managing servers, and finding exactly what you need without getting lost.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/16003/linux-fundamentals-for-devops-filesystem</guid>
<pubDate>Mon, 27 Apr 2026 16:45:41 +0000</pubDate>
</item>
<item>
<title>Linux Fundamentals For DevOps: Linux core mechanism</title>
<link>https://coderlegion.com/16002/linux-fundamentals-for-devops-linux-core-mechanism</link>
<description>&lt;p&gt;Knowing where files live is only half the battle. To be an effective DevOps engineer, you need to know how Linux actually executes programs, manages their lifecycles, and secures them.&lt;br&gt;
The crucial concepts you need to troubleshoot effectively.&lt;/p&gt;
&lt;h3 id=&quot;the-path-variable&quot;&gt;The &lt;code&gt;$PATH&lt;/code&gt; Variable&lt;/h3&gt;
&lt;p&gt;Linux does not search your entire hard drive when you type a command. It only checks a specific, prioritized list of folders. This list is saved in an environment variable called &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You download a new binary tool (like &lt;code&gt;kubectl&lt;/code&gt; or &lt;code&gt;terraform&lt;/code&gt;). You type its name in the terminal, but Linux replies with the dreaded &lt;code&gt;command not found&lt;/code&gt;. To fix this, you must either move the binary into a folder that is already in your &lt;code&gt;$PATH&lt;/code&gt;, or add your custom folder to the &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# Command: View the list of directories Linux currently checks for commands

echo $PATH

# Output Proof (Directories are separated by colons):
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# Command: Add your custom scripts folder to the PATH for the current session

export PATH=&quot;/home/saeed/custom-scripts:$PATH&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;how-binaries-work-shared-libraries-&quot;&gt;How Binaries Work (Shared Libraries)&lt;/h3&gt;
&lt;p&gt;When you run a command like &lt;code&gt;nginx&lt;/code&gt; or &lt;code&gt;python&lt;/code&gt;, you are executing a binary file. In Linux, executables are typically formatted as ELF (Executable and Linkable Format) files. However, most binaries are not standalone; they rely on external pieces of code called shared libraries (&lt;code&gt;.so&lt;/code&gt; files, similar to &lt;code&gt;.dll&lt;/code&gt; files in Windows).&lt;/p&gt;
&lt;p&gt;You compile a Go application or migrate a tool into a minimal Docker container (like Alpine Linux). When you run it, it crashes silently or throws a confusing &lt;code&gt;no such file or directory&lt;/code&gt; error—even though you can see the binary sitting right there. Usually, the binary isn't missing; &lt;strong&gt;its required &lt;em&gt;libraries&lt;/em&gt; are missing.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can use the &lt;code&gt;ldd&lt;/code&gt; command to print the shared libraries required by any program.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# Command: Verify exactly which shared libraries Nginx needs to run
ldd /usr/sbin/nginx

# Output Proof:
        linux-vdso.so.1 (0x00007ffe3b1f4000)
        libcrypt.so.1 =&amp;gt; /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f3a8b411000)
        libpcre.so.3 =&amp;gt; /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f3a8b39c000)
        libssl.so.3 =&amp;gt; /lib/x86_64-linux-gnu/libssl.so.3 (0x00007f3a8b2f6000)
        libc.so.6 =&amp;gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3a8b0cd000)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;file-permission&quot;&gt;File Permission&lt;/h3&gt;
&lt;p&gt;Linux strict permissions dictate exactly who can &lt;strong&gt;R&lt;/strong&gt;ead, &lt;strong&gt;W&lt;/strong&gt;rite, or e&lt;strong&gt;X&lt;/strong&gt;ecute a file. This is often represented by numbers (like 777 or 644).&lt;/p&gt;
&lt;p&gt;You are trying to connect to a cloud server via SSH using a private key (&lt;code&gt;.pem&lt;/code&gt; file), but the connection is instantly rejected. If you set a &lt;code&gt;.pem&lt;/code&gt; file to &lt;code&gt;777&lt;/code&gt; (meaning everyone on the system can &lt;strong&gt;read&lt;/strong&gt;, &lt;strong&gt;write&lt;/strong&gt;, and &lt;strong&gt;execute&lt;/strong&gt; it), SSH will intentionally reject it for being too exposed. Private keys must be set to &lt;code&gt;400&lt;/code&gt;—meaning absolutely no one except the owner is allowed to read it.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# Command: Attempting to SSH with a bad permission key
ssh -i my-key.pem ubuntu@10.0.0.5

# Output Proof:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for 'my-key.pem' are too open.

# Command: Secure the key so only the owner can read it (4), and no one can write (0) or execute (0)

chmod 400 my-key.pem
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;processes-and-signals&quot;&gt;Processes and Signals&lt;/h3&gt;
&lt;p&gt;Every running program is a process assigned a unique Process ID (PID). The operating system communicates with and controls these processes using &quot;Signals.&quot;&lt;/p&gt;
&lt;p&gt;An application is hogging 100% of the CPU and needs to be stopped, or Kubernetes is trying to scale down a pod without dropping active user connections. You can send a &lt;code&gt;SIGTERM&lt;/code&gt; (Signal 15), which politely asks the program to save its data and exit cleanly. Alternatively, a &lt;code&gt;SIGKILL&lt;/code&gt; (Signal 9) forcefully terminates it at the hardware level, bypassing cleanup and potentially causing data corruption.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# Command: Find the Process ID of an application
pgrep -la nginx

# Output Proof:
1234 nginx: master process
1235 nginx: worker process

# Command: Politely ask the master process to shut down and clean up
kill -15 1234
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;file-descriptors&quot;&gt;File Descriptors&lt;/h3&gt;
&lt;p&gt;Remember concept , &lt;strong&gt;&quot;Everything is a File&quot;&lt;/strong&gt;? That rule has a dark side.&lt;/p&gt;
&lt;p&gt;Because Linux treats &lt;strong&gt;&lt;em&gt;network connections&lt;/em&gt;&lt;/strong&gt; as files, every time a user connects to your web server, the operating system opens a &quot;File Descriptor&quot; to track that connection. To protect itself from crashing, the Linux kernel sets strict limits on how many file descriptors a single process can open at once.&lt;/p&gt;
&lt;p&gt;Your Nginx web server or Node.js application is suddenly dropping user connections during a high-traffic spike. You check the CPU and RAM, and both are perfectly fine. You check the Nginx error logs and see the dreaded &lt;code&gt;worker_connections are not enough&lt;/code&gt; or &lt;code&gt;Too many open files&lt;/code&gt; error. The operating system has forcibly stopped your app from accepting new traffic.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;# Command: Show the maximum number of open file descriptors allowed for this user
ulimit -n

# Output Proof:
1024

# Command: Check how many file descriptors the entire system is currently using
cat /proc/sys/fs/file-nr

# Output Proof:
1205   0   9223372036854775807
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;blog-summary-1&quot;&gt;Blog Summary&lt;/h4&gt;
&lt;p&gt;Understanding Linux goes beyond knowing where files live; it’s about understanding how the operating system executes code, secures data, and manages its own limits. This guide breaks down the invisible mechanics of Linux that every DevOps engineer must master to troubleshoot effectively.&lt;/p&gt;
&lt;p&gt;You'll learn why binaries silently fail due to missing shared libraries, how to quickly fix &quot;command not found&quot; errors using the &lt;code&gt;$PATH&lt;/code&gt; variable, and the strict permission rules required to secure SSH keys. We also cover how to safely manage and terminate running processes using signals, and finally, uncover the hidden trap of File Descriptors—explaining why servers suddenly drop connections with &quot;Too many open files&quot; errors and how to raise those limits.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/16002/linux-fundamentals-for-devops-linux-core-mechanism</guid>
<pubDate>Mon, 27 Apr 2026 16:45:13 +0000</pubDate>
</item>
<item>
<title>Beyond the Terminal: My Hunt Through the Linux File System</title>
<link>https://coderlegion.com/15771/beyond-the-terminal-my-hunt-through-the-linux-file-system</link>
<description>&lt;p&gt;At first, Linux felt like magic. You open the terminal, type a command… and things just work. No questions asked. But after a while, that “magic” started bothering me.&lt;/p&gt;
&lt;p&gt;Because I kept thinking:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;Where is all of this actually happening?&lt;/em&gt;&lt;br&gt;
&lt;em&gt;How does the system know what to do?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Like… when I connect to the internet, where is that configuration stored?&lt;br&gt;
When a user logs in, where is that data coming from?&lt;br&gt;
When something breaks, where does Linux keep track of it?&lt;/p&gt;
&lt;p&gt;These weren’t just random questions anymore. They were pulling me deeper.&lt;/p&gt;
&lt;p&gt;So instead of just &lt;em&gt;using&lt;/em&gt; Linux… I decided to &lt;strong&gt;explore it&lt;/strong&gt;. Not like a normal user.&lt;br&gt;
But like someone trying to understand what’s going on behind the scenes.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Digging into folders.&lt;br&gt;
Opening system files.&lt;br&gt;
Trying to connect the dots.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And what I discovered?&lt;/p&gt;
&lt;p&gt;It completely changed how I look at Linux. Because behind every command…&lt;br&gt;
there’s a system quietly doing a lot more than we realize.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-etc---the-place-where-system-behavior-lives&quot;&gt;&lt;code&gt;/etc&lt;/code&gt; - The Place Where System Behavior Lives&lt;/h3&gt;
&lt;p&gt;The first place I explored was &lt;code&gt;/etc&lt;/code&gt;, because I kept hearing that it’s important.&lt;/p&gt;
&lt;p&gt;So I went inside:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;cd /etc
ls
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At first, it just looked like a collection of random files. But the more I opened them, the more I realized something important.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/etc&lt;/code&gt; is not just a folder.&lt;/p&gt;
&lt;p&gt;It is where Linux stores &lt;strong&gt;all configuration that controls system behavior&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/dba90699-454f-4cc7-9a3c-108dba3df80f.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;When I opened files like:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;cat /etc/hosts
cat /etc/passwd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I could literally see how my system is configured.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/8952535f-a89e-4628-8338-f62ce3adb2e7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/dd7b2d29-2731-42ca-b656-cbf8384c9ad4.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This made me realize &lt;em&gt;why this folder exists&lt;/em&gt;. Instead of hardcoding system behavior deep inside programs, Linux stores configurations as editable files. This means the system becomes flexible you can change behavior without touching the core system.&lt;/p&gt;
&lt;p&gt;The problem this solves is huge. Imagine if you had to recompile the OS just to change a setting. That would be impossible for daily use.&lt;/p&gt;
&lt;p&gt;But with &lt;code&gt;/etc&lt;/code&gt;, Linux separates &lt;strong&gt;configuration from execution&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;And the insight that hit me was this:&lt;br&gt;
My system is not controlled by hidden magic. It’s controlled by &lt;strong&gt;plain text files that I can read and understand&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-etc-resolv-conf---how-my-system-finds-websites&quot;&gt;&lt;code&gt;/etc/resolv.conf&lt;/code&gt; - How My System Finds Websites&lt;/h3&gt;
&lt;p&gt;One thing I never really questioned was typing something like:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;ping google.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It just works. But then I stopped and thought:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;How does my system even understand what “&lt;/em&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;http://google.com&quot;&gt;&lt;em&gt;google.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;” is?&lt;/em&gt;&lt;br&gt;
Because at the end of the day, computers don’t understand names, they understand IP addresses.&lt;/p&gt;
&lt;p&gt;So I decided to dig into it.&lt;/p&gt;
&lt;p&gt;I ran:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;cat /etc/resolv.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/bd69aef9-4629-4832-955e-75e99101d859.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;And I saw this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;nameserver 10.0.2.3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At first, this confused me.&lt;/p&gt;
&lt;p&gt;I was expecting something like &lt;code&gt;8.8.8.8&lt;/code&gt; (Google DNS).&lt;br&gt;
But this… looked different.&lt;/p&gt;
&lt;hr&gt;
&lt;h4 id=&quot;so-what-is-this-10-0-2-3&quot;&gt;So what is this &lt;code&gt;10.0.2.3&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;It turns out, this is not a public DNS server. It’s a &lt;strong&gt;local DNS resolver provided by my virtual machine environment&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Since I’m running Linux inside a VM, my system is not directly talking to the internet.&lt;/p&gt;
&lt;p&gt;Instead, it works like this:&lt;/p&gt;
&lt;p&gt;My Linux system → asks &lt;code&gt;10.0.2.3&lt;/code&gt; → which then forwards the request to actual DNS servers&lt;/p&gt;
&lt;p&gt;So basically, &lt;code&gt;10.0.2.3&lt;/code&gt; is acting like a &lt;strong&gt;middleman&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h4 id=&quot;why-does-this-file-exist-&quot;&gt;Why does this file exist?&lt;/h4&gt;
&lt;p&gt;This file tells the system: “If you don’t understand a domain name, ask this nameserver.”&lt;/p&gt;
&lt;p&gt;Without this, the system wouldn’t know where to send DNS queries.&lt;/p&gt;
&lt;hr&gt;
&lt;h4 id=&quot;what-problem-does-it-solve-&quot;&gt;What problem does it solve?&lt;/h4&gt;
&lt;p&gt;Humans use names like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;http://google.com&quot;&gt;google.com&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;http://youtube.com&quot;&gt;youtube.com&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But systems use IP addresses. So DNS acts as a &lt;strong&gt;translator&lt;/strong&gt; between human-friendly names and machine-friendly IPs.&lt;/p&gt;
&lt;p&gt;And &lt;code&gt;/etc/resolv.conf&lt;/code&gt; tells Linux &lt;em&gt;where that translator lives&lt;/em&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h4 id=&quot;what-i-found-interesting&quot;&gt;What I found interesting&lt;/h4&gt;
&lt;p&gt;The biggest realization for me was this: My system isn’t always directly using public DNS.&lt;br&gt;
In my case, it’s using a &lt;strong&gt;local resolver (10.0.2.3)&lt;/strong&gt;, which then handles everything behind the scenes.&lt;/p&gt;
&lt;p&gt;That means even something as simple as opening a website involves:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;local system configuration&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;virtual networking layers&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DNS forwarding&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4 id=&quot;small-but-powerful-insight&quot;&gt;Small but powerful insight&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;Just by changing this file, I can control how my system resolves domains.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Which means I can switch to a faster DNS, block certain domains, &amp;amp; control network behavior.&lt;/p&gt;
&lt;p&gt;And honestly… Something as simple as opening a website suddenly felt &lt;strong&gt;way deeper than I thought&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;routing-table---how-linux-decides-where-data-goes&quot;&gt;Routing Table - How Linux Decides Where Data Goes&lt;/h3&gt;
&lt;p&gt;Next, I wanted to understand how my system sends data.&lt;/p&gt;
&lt;p&gt;So I ran:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;ip route
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What I saw was something like:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/1fddee76-f327-4faa-bb16-91158aff8197.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This is the routing table.&lt;/p&gt;
&lt;p&gt;At a basic level, this tells the system: &lt;em&gt;“If you don’t know where to send data, send it to this gateway.”&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In my case, that gateway is &lt;code&gt;10.0.2.2&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This exists because your system doesn’t just randomly send data. It needs a structured way to decide where packets go.&lt;/p&gt;
&lt;p&gt;The problem it solves is routing confusion. Without this, your system wouldn’t know whether to send data locally or over the internet.&lt;/p&gt;
&lt;p&gt;The second line (&lt;code&gt;10.0.2.0/24&lt;/code&gt;) tells the system that anything in this local network range can be accessed directly, without going through the gateway.&lt;/p&gt;
&lt;p&gt;The insight here was surprising: My system is not just sending data it’s making &lt;strong&gt;routing decisions like a mini network controller&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;And since I’m using a virtual machine, &lt;code&gt;10.0.2.2&lt;/code&gt; is actually a &lt;strong&gt;virtual gateway&lt;/strong&gt;, not a physical router.&lt;/p&gt;
&lt;p&gt;I always thought networking happens “somewhere outside”. But Linux is actively involved in deciding paths. And in this case, it’s even routing traffic through a virtual layer before it reaches the real network.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-var-log---the-silent-observer-of-everything&quot;&gt;&lt;code&gt;/var/log&lt;/code&gt; - The Silent Observer of Everything&lt;/h3&gt;
&lt;p&gt;Then I explored logs:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;cd /var/log
ls
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/6804e197-0fe4-4b02-8de9-942abd566740.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;And opened files like:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;cat messages
cat secure
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This folder is basically the &lt;strong&gt;memory of the system&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Everything that happens:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;logins&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;errors&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;services&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;system events&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;…it all gets recorded here. This exists because systems need a way to track what’s happening internally.&lt;br&gt;
The problem it solves is debugging and monitoring. Without logs, if something breaks, you’re blind.&lt;/p&gt;
&lt;p&gt;But what really stood out to me was this:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Linux doesn’t interrupt you with errors all the time.&lt;br&gt;
It quietly writes everything down.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It’s like the system is constantly saying:&lt;br&gt;
“I’ll tell you everything… but only if you come and look.”&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-etc-passwd-amp-etc-shadow---how-linux-handles-users-securely&quot;&gt;&lt;code&gt;/etc/passwd&lt;/code&gt; &amp;amp; &lt;code&gt;/etc/shadow&lt;/code&gt; - How Linux Handles Users Securely&lt;/h3&gt;
&lt;p&gt;To understand users, I ran:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;cat /etc/passwd
sudo cat /etc/shadow
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What I saw was interesting.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/c9f9d74e-3a88-4f9a-9772-4e9b876f4006.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/etc/passwd&lt;/code&gt; contains user details.&lt;/p&gt;
&lt;p&gt;But passwords are not there.&lt;/p&gt;
&lt;p&gt;They’re stored in &lt;code&gt;/etc/shadow&lt;/code&gt;, which requires special permissions.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/f8886199-5b1b-460d-8c26-1fb50204d8de.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This exists for security reasons. If everything was stored in one place, anyone could read sensitive data.&lt;/p&gt;
&lt;p&gt;The problem it solves is protecting user credentials.&lt;/p&gt;
&lt;p&gt;But the insight here was deeper:&lt;/p&gt;
&lt;p&gt;Linux separates identity from authentication.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;/etc/passwd&lt;/code&gt; → who you are&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;/etc/shadow&lt;/code&gt; → how you prove it&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That separation makes the system more secure by design.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;permissions---built-in-security-not-an-add-on&quot;&gt;Permissions - Built-In Security, Not an Add-On&lt;/h3&gt;
&lt;p&gt;When I ran:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;ls -l
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I saw things like:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;-rwxr-xr--
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/fe6fc764-6e65-41a7-9cac-2ba703eaedbd.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;At first, it looked confusing. But then i understood: this is how Linux controls access to every file.&lt;/p&gt;
&lt;p&gt;Permissions exist because not every user should have full control over everything.&lt;/p&gt;
&lt;p&gt;The problem it solves is unauthorized access and system damage.&lt;/p&gt;
&lt;p&gt;But what really stood out was:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Security in Linux is not something extra.&lt;br&gt;
It is built directly into the file system itself.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Every file carries its own rules.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-proc---where-i-saw-the-system-live&quot;&gt;&lt;code&gt;/proc&lt;/code&gt; - Where I Saw the System Live&lt;/h3&gt;
&lt;p&gt;This was the most surprising part&lt;/p&gt;
&lt;p&gt;I explored:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;cd /proc
ls
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/9149fc76-6d64-4f95-a1b6-6e8adbb6bc22.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;And then:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;cat /proc/cpuinfo
cat /proc/meminfo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/d758033f-d9de-42a3-8fc1-8148de180518.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/6f75e522-7ea9-4302-9705-27d31df5d31f.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;What I realized is: These are not real files stored on disk. They are generated in &lt;strong&gt;real time by the kernel&lt;/strong&gt;. This exists so users and programs can access live system data.&lt;br&gt;
The problem it solves is system monitoring.&lt;/p&gt;
&lt;p&gt;But the insight here blew my mind:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;When I read these files, I’m not reading stored data.&lt;br&gt;
I’m interacting with the system &lt;em&gt;live&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It felt like I was directly talking to Linux.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-dev---where-hardware-becomes-files&quot;&gt;&lt;code&gt;/dev&lt;/code&gt; - Where Hardware Becomes Files&lt;/h3&gt;
&lt;p&gt;Then I explored:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;ls /dev
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I saw entries for disks, terminals, and devices.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/d61e42c5-dae6-40ac-8bc4-c8aea3435d04.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This exists because Linux treats hardware as files.&lt;/p&gt;
&lt;p&gt;The problem it solves is complexity. Instead of learning different ways to interact with devices, everything becomes file operations.&lt;/p&gt;
&lt;p&gt;And the insight here was simple but powerful: In Linux, everything is unified under one idea: files.&lt;/p&gt;
&lt;p&gt;That consistency makes the system elegant.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-boot---the-starting-point-of-everything&quot;&gt;&lt;code&gt;/boot&lt;/code&gt; - The Starting Point of Everything&lt;/h3&gt;
&lt;p&gt;Finally, I checked:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;ls /boot
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This folder contains the kernel and bootloader files.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/e1042324-f3ca-4bff-a7b6-a4b3df12c46d.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;This exists because the system needs instructions to start itself. The problem it solves is system initialization.&lt;br&gt;
And the insight: Without &lt;code&gt;/boot&lt;/code&gt;, Linux cannot even begin to run.&lt;/p&gt;
&lt;p&gt;It’s literally where everything starts.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-var-log-secure---who-tried-to-enter-my-system-&quot;&gt;&lt;code&gt;/var/log/secure&lt;/code&gt; - Who Tried to Enter My System?&lt;/h3&gt;
&lt;p&gt;While exploring logs, I went deeper:&lt;/p&gt;
&lt;p&gt;So I ran:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;sudo tail -f /var/log/secure
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/f74b3e91-c729-457b-8959-8937be20b451.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;And what I saw was honestly eye-opening.&lt;/p&gt;
&lt;p&gt;This file logs things like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;login attempts&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;sudo usage&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;authentication failures&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Basically… anything related to &lt;strong&gt;who is trying to access the system&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This exists because systems need to keep track of access.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Who logged in&lt;br&gt;
Who tried and failed&lt;br&gt;
Who used admin privileges&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Without something like this, there would be no way to monitor system security.&lt;/p&gt;
&lt;p&gt;The problem it solves is pretty serious. If something suspicious happens, like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;repeated failed login attempts&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;unauthorized access&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;misuse of sudo&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;you need a way to trace it. And that’s exactly what this file does. The insight here really changed how I see system logs.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Linux doesn’t constantly warn you about everything.&lt;br&gt;
Instead, it quietly records everything in the background.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And this file becomes like a &lt;strong&gt;security audit trail&lt;/strong&gt;. If someone tries to break into your system… the evidence is already there.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-dev-null---the-black-hole-of-linux&quot;&gt;&lt;code&gt;/dev/null&lt;/code&gt; - The Black Hole of Linux&lt;/h3&gt;
&lt;p&gt;This one was honestly one of the coolest discoveries.&lt;/p&gt;
&lt;p&gt;I started with something simple:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;ls /dev/null
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then I tried this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;echo &quot;hello&quot; &amp;gt; /dev/null
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And… it disappeared.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/a07e4e13-1593-4e1c-a368-3ae8b5c8c2e7.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;No output. Nothing showed up anywhere. That’s when I realized what was happening.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/dev/null&lt;/code&gt; is a special file that &lt;strong&gt;discards anything written to it&lt;/strong&gt;. This exists because sometimes, you don’t care about output. Maybe a command is producing too much noise, or you just want to run something silently.&lt;/p&gt;
&lt;p&gt;The problem it solves is simple but important. Without &lt;code&gt;/dev/null&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;your terminal would get cluttered&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;scripts would print unnecessary output&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;things would become harder to manage&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The insight here was actually pretty cool.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/dev/null&lt;/code&gt; is like a black hole. Anything goes in… and nothing comes out. And suddenly, this made sense:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;command &amp;gt; /dev/null 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This basically tells the system:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Run the command, but don’t show me anything.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And now I finally understood why developers use it so often.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;systemd---the-hidden-manager-running-everything&quot;&gt;&lt;code&gt;systemd&lt;/code&gt; - The Hidden Manager Running Everything&lt;/h3&gt;
&lt;p&gt;Then I got curious about what’s running behind the scenes.&lt;/p&gt;
&lt;p&gt;So I explored:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;cd /etc/systemd/system
ls
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.hashnode.com/uploads/covers/69382f58e4ddfd795d01b951/e45e98ea-2cc7-495c-9822-8913298b7bb6.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;At first, it just looked like a bunch of configuration files.&lt;/p&gt;
&lt;p&gt;But then it clicked. This is where &lt;strong&gt;system services are defined and managed&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;systemd&lt;/code&gt; is basically the component that handles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;services&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;startup processes&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;background tasks&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It’s the reason your system feels “alive” even when you’re not doing anything.&lt;/p&gt;
&lt;p&gt;This exists because modern systems need automation. You don’t manually start things like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;networking&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;logging&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;system monitoring&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every time you boot your system.&lt;/p&gt;
&lt;p&gt;The problem it solves is huge. Without something like &lt;code&gt;systemd&lt;/code&gt; you would have to manually start every service after boot . Which is clearly not practical. The insight here was interesting. Even when I’m doing nothing…&lt;br&gt;
Linux is still running multiple services silently in the background. Things just work because &lt;code&gt;systemd&lt;/code&gt; is managing everything for me.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-boot-grub2-grub-cfg---the-first-instructions-linux-follows&quot;&gt;&lt;code&gt;/boot/grub2/grub.cfg&lt;/code&gt; - The First Instructions Linux Follows&lt;/h3&gt;
&lt;p&gt;This one felt powerful.&lt;/p&gt;
&lt;p&gt;I ran:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-plaintext&quot;&gt;cat /boot/grub2/grub.cfg
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And I was looking at the configuration used by GRUB the bootloader.&lt;/p&gt;
&lt;p&gt;This file tells the system:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;which kernel to load&lt;br&gt;
how to start Linux&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This exists because before Linux even starts, something needs to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;initialize the system&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;load the kernel&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;hand over control to the OS&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And that’s exactly what the bootloader does.&lt;/p&gt;
&lt;p&gt;The problem it solves is fundamental. Without this configuration:&lt;br&gt;
the system wouldn’t even know how to boot. No startup. No OS. Nothing.&lt;/p&gt;
&lt;p&gt;The insight here made me realize how critical this file is. This is literally where the system’s startup behavior is defined. If this file gets corrupted Linux won’t even start&lt;br&gt;
And that’s when it hit me… This isn’t just another config file. This is the starting point of everything.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;After exploring all these parts, one thing became very clear to me:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Linux is not just an operating system&lt;br&gt;
It is a collection of &lt;strong&gt;well-structured systems connected through files&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;From booting → to users → to networking → to logs&lt;/p&gt;
&lt;p&gt;Everything is transparent, accessible, &amp;amp; understandable.&lt;br&gt;
And once you start exploring it like this… you stop guessing and start understanding.&lt;/p&gt;
&lt;p&gt;Linux is not hiding anything from you.&lt;br&gt;
Everything is there in files, waiting to be explored.&lt;/p&gt;
&lt;p&gt;The moment you stop just using Linux… and start reading it… that’s when things finally start clicking.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/15771/beyond-the-terminal-my-hunt-through-the-linux-file-system</guid>
<pubDate>Sat, 25 Apr 2026 05:07:24 +0000</pubDate>
</item>
</channel>
</rss>