# Linux File System Hunting

Let's start with who am I in the system it tell the user name of your linux systems

```shell
whoami
```

![](https://cdn.hashnode.com/uploads/covers/67e41ba26be2bc2400a699ee/acf6f97f-8f8a-4b53-9cad-e85507de6729.png align="center")

In Linux everything is file the command we are using those are also files. As we some commands like: cd, ls, pwd these are also files

For seeing those we need to go first in the root folder " / " on doing ls command you able to see the bin folder that take all command file of binary.

```shell
cd bin
cat ls
```

![](https://cdn.hashnode.com/uploads/covers/67e41ba26be2bc2400a699ee/79cdcc43-a31e-49ca-b856-06ef3f9264c7.png align="center")

So, now you know all things in linux is file.

> Linux doesn’t just store data in files — it *runs the entire system through them*.

## `/etc` -- Configure the Brain of System

When you list your files in root directory you see a directory of name "etc" in this you can configure each and every thing of the system and in linux configuration and program are different.

> This directory is basically the control panel of Linux.

*   `/etc/hosts` → manual DNS mapping
    
*   `/etc/resolv.conf` → DNS servers
    
*   `/etc/passwd` → user definitions
    
*   `/etc/fstab` → mount rules
    

In linux we can configuration without recompiling code

> Change a file → change system behavior instantly

## DNS Resolution

I always thought DNS is something handled “somewhere on the internet.” But Linux actually tries locally first.  
**Internals** When you access a domain:  
1\. Linux checks `/etc/hosts`  
2\. If not found → uses `/etc/resolv.conf` to query DNS servers

Its helps in the  
\- Testing the applications locally  
\- Blocking domains  
\- Faster resolution for known mappings

> You control DNS before the internet does.

That means you can:  
\- Redirect domains  
\- Simulate servers locally  
\- Debug network issues easily

## `/proc` — Live Kernel Data

This directory completely changed how I see Linux. `/proc` is not stored on disk. It is a **virtual filesystem generated by the kernel in real time.**

What it contains:  
\- `/proc/cpuinfo` → CPU details  
\- `/proc/meminfo` → memory usage  
\- `/proc/<pid>/` → each running process

Its helps in the exposing system internals without special tools. Monitoring system resources, Debugging performance issues, Understanding processes

> You don’t need tools to inspect the system — Linux gives raw data directly.

## `/dev` — Hardware Abstraction Layer

When I explored `/dev`, I expected drivers or binaries. Instead, I saw files. But it represents hardware devices as files. Like:  
\- `/dev/sda` → storage disk  
\- `/dev/null` → discards data  
\- `/dev/tty` → terminal

This helps in the "To unify hardware interaction." No need for different APIs for each device. Programs can use simple file operations

> Linux doesn’t treat hardware differently — it treats everything as a file.

## `/var/log` — System’s Memory

While exploring logs, I realized: Logs are not just error messages — they are system history. It contains the:  
\- Authentication logs  
\- System events  
\- Service logs

It tracks everything in the system. That helps in Debugging crashes, Security monitoring, Performance analysis

> If something goes wrong, logs will always tell you why.

## User System

Users in Linux are not stored in a database. They are stored in files. `/etc/passwd` It contains:  
\- Username  
\- UID (User ID)  
\- Home directory  
\- Default shell

`/etc/shadow` contains:  
\- Encrypted passwords  
\- Security settings

To keep identity and authentication separate we have this. Thats help in Improves security and also Allows flexible user management.

> Linux user system is transparent.

## Permissions — Real Security Layer

Initially, permissions looked simple. But they are actually very powerful.

Structure: Each file has  
\- owner  
\- Group  
\- Others  
And each has the Read(r), Write(w), Execute(x).

Linux is multi user system in which we need Prevents unauthorized access and Controls execution rights  
A file exists ≠ it can run.

> Execution is a permission, not a property.

## `/boot` — System Startup Logic

This directory is small but critical. It contains:  
\- Kernel files  
\- Bootloader configuration  
This initialize the system. It Loads OS into memory and Starts system services.

> Booting is just loading the kernel + executing instructions.

No magic — just structured steps.

## `systemd` — Invisible System Manager

Modern Linux uses systemd to manage services. It Starts services at boot, Manages background processes and Handles dependencies. It do the Automation and consistency. It do Manual service handling and Dependency conflicts.

> Even when you do nothing, Linux is running dozens of services.

## Networking & Routing — How Data Moves

Networking felt abstract before. Now it feels structured. Linux maintains:  
\- Network interfaces  
\- Routing tables  
\- DNS configs  
System needs to know:  
\- Internet connectivity  
\- Multi-network environments

> Internet = Routing + DNS + Interfaces

Once you understand these, networking becomes logical.
