🐧 Diving Into the Linux Filesystem Structure

If you’ve just started exploring Linux, you’ve probably run into a bunch of folders with weird names like /etc, /var, or /usr. At first glance, it might look confusing — even intimidating — but once you understand the structure, it all starts to make sense.

This post is here to break it down for you in a simple, friendly way. By the end, you'll know your way around the Linux filesystem like a local.


📁 So, What’s the Linux Filesystem Anyway?

In Linux, everything lives under a single directory: /, known as the root directory (not to be confused with the root user). It’s kind of like the trunk of a tree. All other directories branch out from it.

Unlike Windows, which uses drive letters like C:\ or D:\, Linux uses one unified directory tree — your hard drive, USBs, system files, everything gets “mounted” into this tree somewhere.


🌳 The Filesystem Tree (With Real-World Analogies)

Here’s a rundown of the key directories you’ll find in Linux, along with a bit of what they’re for. I’ll keep the tech talk light and sprinkle in a few analogies to make it stick.

DirectoryWhat It’s For
/The root of it all. Everything on your system starts here.
/binor /usr/binEssential user commands like ls, cp, and rm. If something breaks here, you're in trouble.
/bootAll the files needed to boot up your system, including the Linux kernel.
/devRepresents your devices. Disks, USBs, even your mouse — all show up as files here.
/etcSystem configuration files live here. If /etc was a room, it’d be the server closet full of switches and settings.
/homeThis is where your stuff goes. Every user gets a personal directory, like /home/utsav
/lib or /usr/libShared libraries that help software run. Like C standard Library files needed by commands and application
/mediaWhen you plug in a USB stick or insert a CD, it gets mounted here.
/mntA generic mount point — used mostly by system admins for mounting extra stuff manually. Mounts external file system
/optOptional software or add-on applications lives here — stuff that isn’t part of the core OS.
/procA strange one — it's a virtual filesystem that gives you info about running processes and the kernel, processes that only exist in the memory.
/rootThe home directory of the root user (i.e., the system's superadmin). It is not the same as /
/runStores temporary runtime data for system processes and daemons that start very early in the boot process — like systemd and udevd. It holds things like PID files, sockets, and other state information needed while the system is running.
/sbinSimilar to /bin, but specifically for system binaries used by admins.
/srvData for services like web or FTP servers. Kind of like /var, but service-specific.
/sysAnother virtual filesystem that gives info about hardware and kernel modules.
/tmpA place for temporary files. Gets cleaned up automatically. Think of it as a scratchpad.
/usrShort for “Unix System Resources” — basically where most of the user-installed software lives.
/varStands for variable — because this data changes often. Logs, emails, and such go here.

🧠 Think of It Like a House

If the Linux filesystem was your house:

  • / is the front door.

  • /home is your bedroom.

  • /etc is the electrical panel — full of wires and switches.

  • /bin and /sbin are your toolboxes.

  • /tmp is the sticky note on your fridge.

  • /dev is your collection of power outlets connected to devices.

  • /var/log is your diary — it records everything.



✨ Wrapping Up

The Linux filesystem might seem intimidating at first glance, but it’s actually pretty logical once you break it down. Everything has its place and purpose. Bookmark this post, explore a bit using cd, ls, and tree, and don’t be afraid to poke around (carefully!).

Got questions? Drop them in the comments — or let me know if you'd like a deeper dive into any of the folders we covered.

Happy exploring! 🐧

0
Subscribe to my newsletter

Read articles from Utsav Lamichhane directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Utsav Lamichhane
Utsav Lamichhane