Skip to main content

Command Palette

Search for a command to run...

Understanding linux filesystem

Beginner-Friendly Guide to Linux Filesystem

Updated
5 min readView as Markdown
Understanding linux filesystem

Introduction

When I first logged into a Linux machine, I typed ls and saw a list of folders I did not understand at all. Names like bin, etc, dev, and proc meant nothing to me. I wondered if I could delete them or if they did anything important. Spoiler alert they do.

This blog is for anyone who feels lost inside the Linux filesystem. I will walk you through the major directories found under the root, explain what they actually do, and share a few practical things I learned by poking around these folders. Once you understand these directories, Linux will stop feeling like a black box and start feeling like your own workspace.

Visual Map of the Linux Filesystem

Now let us go through them one by one.

1. bin

What it is: This folder holds basic command line tools that every user needs.

Examples: ls, cp, mv, rm, cat

Why it matters: These commands are available even if the system is in recovery mode. That is why they live right under root and not somewhere deep inside.

What I learned: You can run ls /bin and see many familiar commands. If this folder ever gets corrupted, your basic Linux tools will stop working.

2. sbin

What it is: Like bin, but for system administration tools. These are mostly for root users.

Examples: shutdown, reboot, ifconfig, iptables

Why it matters: When you are configuring the network or managing services, you are probably using commands from here.

What I learned: Many commands in this folder will say “permission denied” unless you use sudo. That is normal.

3. etc

What it is: This is the brain of your Linux system. It holds all configuration files.

Examples: /etc/passwd, /etc/ssh/sshd_config, /etc/hosts

Why it matters: Want to change how a service behaves? You probably have to edit a file here.

What I learned: Do not randomly edit files here unless you know what they do. But reading them is safe and educational.

4. home

What it is: This is where all regular users have their personal files and folders.

Examples: /home/shruthi

Why it matters: Everything you download, save, or write as a user lives here.

What I learned: If you reinstall Linux and do not format the home partition, your personal files stay safe.

5. root

What it is: This is the home directory for the root user.

Why it matters: It is like home, but only for the superuser.

What I learned: Do not confuse /root with /. The root directory is the base of everything. The /root folder is just like a private office for the administrator.

6. var

What it is: This folder holds variable data. That means logs, caches, print jobs, and mail queues.

Examples: /var/log, /var/cache, /var/tmp

Why it matters: Log files are crucial for debugging, checking system status, or investigating a hack.

What I learned: When something crashes, check /var/log/syslog or /var/log/auth.log. That is where the truth often lives.

7. usr

What it is: It stands for “user system resources.” It has user-facing applications and files.

Examples: /usr/bin, /usr/lib, /usr/share

Why it matters: This is the largest part of the system. Most of the software you install will land here.

What I learned: Even though it says “user,” it is not the same as the /home folder. This is about shared system-wide applications.

8. opt

What it is: Optional software goes here. Especially third party applications.

Examples: Google Chrome or VS Code installed manually

Why it matters: If a program is not from your distro’s default repo, it may live here.

What I learned: Some advanced users install heavy applications here to keep them separate from system files.

9. dev

What it is: Device files. Every hardware item is treated like a file here.

Examples: /dev/sda, /dev/tty, /dev/null

Why it matters: If you want to access your hard disk or USB manually, this is where you go.

What I learned: You can cat /dev/random and get endless junk data. Try it once for fun.

10. proc

What it is: A virtual directory showing info about system processes.

Examples: /proc/cpuinfo, /proc/meminfo, /proc/1

Why it matters: The kernel creates this on the fly. You can see every process as a numbered folder.

What I learned: cat /proc/cpuinfo tells you your processor details. No need to install tools.

11. sys

What it is: Another virtual folder like /proc, but more focused on the hardware.

Examples: /sys/class/net, /sys/devices

Why it matters: Tools like udevadm and systemd use this for low level info.

What I learned: I rarely touched this directly, but it helps you understand how Linux sees devices.

12. tmp

What it is: A place for temporary files.

Why it matters: Programs store short term data here. It is wiped on reboot.

What I learned: If you are testing scripts or files you do not want to keep, save them here.

13. boot

What it is: Holds boot loader files and the Linux kernel.

Examples: vmlinuz, initrd.img, grub

Why it matters: If this is corrupted, your system may not boot.

What I learned: I never touch this folder unless I am updating kernels or troubleshooting boot issues.

14. lib and lib64

What it is: System libraries for bin and sbin programs.

Why it matters: Without these, your core commands will not work.

What I learned: Sometimes I got errors like “library not found” and realized it was due to missing files here.

Final Thoughts

At first glance, Linux folders feel like random letters. But once you start exploring them, each one tells a story. You begin to see how the system is organized, why certain files live where they do, and how you can debug issues just by navigating the filesystem.The best way to learn this is not by reading, but by playing around in a virtual machine. Run ls, explore the folders, read config files, and break things. That is how I learned what no textbook could teach.If you are just beginning with Linux, do not rush. Start with understanding what each folder is doing. Soon, you will feel at home in the root.