DEV Community

SachinDasCK
SachinDasCK

Posted on

Ever wondered what’s really inside a Linux machine?

Most of us use Linux every day — in servers, cloud, DevOps pipelines, Docker images —
but only a few truly understand the “city map” of the operating system.

Last week, I spent time revisiting the Linux directory structure, and trust me…
once you understand where things live, everything from debugging to deployments gets 10x easier.

Here’s a simple mental model of the Linux filesystem (with zero jargon):

Linux Directories Explained Like a Map

🔹 /bin → The Main Market
Where essential day-to-day commands live (ls, cp, mv). Always open, accessible to all.

🔹 /sbin → The Control Room
Admin-level tools for networking, boot, recovery. Root-only stuff happens here.

🔹 /lib → The Power Grid
All the core libraries and kernel modules that keep the system running.

🔹 /opt → The Mall
Third-party apps and optional software go here.

🔹 /mnt → The Parking Lot
Temporary space where you manually mount extra disks or storage.

🔹 /media → The Auto Parking
USB drives, CDs, SD cards — mounted automatically.

🔹 /var → The Daily Newspaper Hub
Logs, cache, databases — everything that keeps changing goes here.

🔹 /home → Residential Area
Every user has a “house” here with their files and settings.

🔹 /tmp → Food Court Trash Zone
Temporary files that get cleaned up automatically.

🔹 /proc → The CCTV Room
Live, real-time information about processes, CPU, memory.

🔹 /root → The VIP Bungalow
Home directory of the system’s superuser.

🔹 /etc → The City Council Office
All configuration files and rules for the whole system.

Top comments (0)