Skip to main content

Command Palette

Search for a command to run...

Understanding the Linux Folder Structure

Published
β€’3 min read
Understanding the Linux Folder Structure

If you’re coming from Windows, Linux can feel a bit confusing at first β€” especially when there are no C: or D: drives. Instead, Linux uses one single folder tree, and everything lives inside it.

Let’s make this simple and familiar.


🌳 The Linux Folder Tree (Big Picture)

/
β”œβ”€β”€ bin
β”œβ”€β”€ sbin
β”œβ”€β”€ etc
β”œβ”€β”€ home
β”œβ”€β”€ lib
β”œβ”€β”€ lib64
β”œβ”€β”€ var
β”œβ”€β”€ tmp
β”œβ”€β”€ media
└── mnt

Think of / (root) as β€œMy Computer” in Windows β€” everything starts here.

Below, we’ll walk through these folders from a Windows user’s perspective, using comparisons you already understand.


πŸ“ /bin β€” Basic Commands (Like Windows System Tools)

What it is:
/bin contains essential command-line programs that every user needs.

Examples:

  • ls β†’ list files (like dir)

  • cp β†’ copy files

  • mv β†’ move/rename files

Windows comparison:

Similar to core utilities inside C:\Windows\System32

Why it’s necessary:
Linux needs these tools even when the system is in recovery mode. Without /bin, you couldn’t even list files or copy anything.


πŸ“ /sbin β€” System Admin Tools (Advanced System32)

What it is:
System-level commands mainly used by administrators (root).

Examples:

  • Disk mounting

  • Network setup

  • System repair tools

Windows comparison:

Like advanced admin tools or utilities you’d run as Administrator

Why it’s necessary:
These tools keep the system healthy β€” mounting disks, fixing file systems, managing services.


πŸ“ /home β€” User Profiles (Very Familiar!)

What it is:
This is where user data lives.

/home/pritom

Contains:

  • Documents

  • Downloads

  • Pictures

  • App settings

  • Dev projects

Windows comparison:

C:\Users\YourName

Why it’s necessary:
It cleanly separates user data from system data, making Linux safer and easier to maintain.


πŸ“ /etc β€” Configuration Files (The Control Panel Behind the Scenes)

What it is:
System-wide configuration files (mostly plain text).

Examples:

  • User accounts

  • Network settings

  • App configurations

Windows comparison:

A mix of Registry + config files spread across Windows folders

Why it’s necessary:
Instead of hiding settings in a binary registry, Linux keeps configs readable and editable β€” easier to debug and automate.


πŸ“ /lib β€” System Libraries (DLLs)

What it is:
Shared libraries required by system programs.

Windows comparison:

.dll files in System32

Why it’s necessary:
Programs reuse these libraries instead of shipping everything themselves β€” saves space and keeps updates clean.


πŸ“ /lib64 β€” 64-bit Libraries

What it is:
Same idea as /lib, but specifically for 64-bit programs.

Windows comparison:

Difference between System32 and SysWOW64

Why it’s necessary:
Keeps 32-bit and 64-bit compatibility cleanly separated.


πŸ“ /var β€” Changing Data (Logs & History)

What it is:
Files that change frequently.

Examples:

  • Logs (/var/log)

  • Cache

  • App runtime data

Windows comparison:

Event Viewer logs + AppData temp/cache files

Why it’s necessary:
Keeps growing, changing data away from core system files β€” easier cleanup and troubleshooting.


πŸ“ /tmp β€” Temporary Files (Scratch Space)

What it is:
Temporary files created by apps.

Windows comparison:

C:\Windows\Temp

Why it’s necessary:
Linux automatically cleans this up β€” often on reboot β€” so junk doesn’t pile up.


πŸ“ /media β€” USB & External Drives

What it is:
Automatically mounted removable devices.

Examples:

  • USB drives

  • External HDDs

Windows comparison:

Plugging in a USB and getting E: or F:

Why it’s necessary:
Instead of assigning drive letters, Linux mounts devices as folders.


πŸ“ /mnt β€” Manual Mounting Space

What it is:
Used by users/admins to manually attach disks.

Windows comparison:

Manually mapping a network drive

Why it’s necessary:
Great for testing disks, backups, or temporary mounts without affecting the main system.

Happy learning and peace ✌️.