🗂️Understand Linux File System: The Backbone of Everything You Do

When you think of Linux, you probably imagine commands, terminals, and maybe the kernel. But underneath all of that, the Linux file system is quietly doing the heavy lifting — organizing your files, devices, configurations, and even memory into a structured hierarchy.

In this blog, let’s demystify the Linux file system — what it is, how it's structured, and why it’s so powerful.

What is the Linux File System?

At its core, the Linux file system (LFS) is how Linux stores and organizes data on disk. Everything in Linux is treated as a file — yes, everything. This includes:

  • Regular files (like .txt, .sh, .py)

  • Directories (folders)

  • Devices (like your USB drive or keyboard)

  • Sockets, pipes, and more.

Even your running processes and hardware configurations are represented as files.

The File System Hierarchy: Linux’s Rooted Tree

Linux uses a hierarchical tree structure, with the root directory / at the top. All files and directories stem from this root.

Here's a look at the common directories and what they mean:

DirectoryWhat it Stores
/The root of the file system. Everything starts here.
/binEssential user binaries (e.g., ls, cat, cp).
/sbinSystem binaries (used by the system admin).
/etcConfiguration files (network, users, services).
/devDevice files (USBs, hard drives, etc.).
/procVirtual filesystem with info about running processes.
/varVariable data like logs and spool files.
/tmpTemporary files, often cleared on reboot.
/usrUser software and files (shared across systems).
/homeHome directories of individual users.
/bootBoot loader files (like GRUB, kernel image).
/libShared libraries required by programs in /bin and /sbin.

Real-Life Example: Exploring the File System

Try this on your Linux terminal:

cd /
ls

You’ll see a list of top-level directories like bin, etc, home, etc. Let’s say you want to check your system’s uptime using the /proc virtual file system:

cat /proc/uptime

Boom — Linux just read that data as if it were a file, even though it’s generated on the fly.

Types of Files in Linux

Linux doesn’t just deal with “files” like .txt or .exe. It recognizes several types:

  • Regular files (-) – Text, images, binaries.

  • Directories (d) – Folders.

  • Symbolic links (l) – Shortcuts to other files.

  • Character devices (c) – Keyboard, mouse, etc.

  • Block devices (b) – Hard drives.

  • Named pipes (p) – Inter-process communication.

  • Sockets (s) – Used for networking.

Check a file’s type using:

ls -l

File Permissions and Ownership

In Linux, each file or directory has:

  • Owner (user who created it),

  • Group (user group it belongs to),

  • Permissions (read/write/execute for each).

Example:

rw-r--r-- 1 anuj users 1234 May 17 10:00 hello.txt

This shows:

  • rw- → owner can read/write,

  • r-- → group can read,

  • r-- → others can read.

You can modify permissions using chmod, chown, etc.

What’s a Mount Point?

Linux can mount different storage devices (USB, drives, network file systems) anywhere in its hierarchy — not just drive letters like C: or D: in Windows.

For example:

sudo mount /dev/sdb1 /mnt/usb

Now you can access your USB files at /mnt/usb.

Why It Matters: Real-World Developer Use Cases

  1. DevOps Engineers need to navigate /var/log, /etc for logs and configurations.

  2. Developers often store configs in /etc, deploy apps under /opt, or read from /proc.

  3. Security Analysts monitor permissions and access in sensitive directories like /boot and /home.

  4. Sysadmins regularly mount/unmount file systems, tweak /etc/fstab, or monitor /proc/meminfo.

Bonus Tip: Learn Using tree and find

sudo apt install tree
tree -L 2 /

Want to find a specific config file?

find /etc -name "ssh*"

Final Thoughts

The Linux file system is more than just folders and files — it's a design philosophy. Once you understand how Linux organizes data, configuration, and processes, you unlock superpowers that help you build, debug, and secure systems like a pro.

And remember: In Linux, everything is a file — and that’s a good thing.

đź’¬ Have questions about /proc, fstab, or mount? Let me know in the comments or reply with your favorite Linux file system tip!

10
Subscribe to my newsletter

Read articles from Anuj Kumar Upadhyay directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anuj Kumar Upadhyay
Anuj Kumar Upadhyay

I am a developer from India. I am passionate to contribute to the tech community through my writing. Currently i am in my Graduation in Computer Application.