DEV Community

LaTerral Williams
LaTerral Williams

Posted on

🐧A Beginner's Guide to Linux File Hierarchy System (with Windows Comparisons)

When you first dive into Linux, the directory structure might look a little intimidating. But once you understand the core folders and what they’re used for, it all starts to make a bit more sense. One way to make things more understandable is by making comparisons to Windows.

πŸ‘‹ Quick confession: I'm currently working through a Linux course myself! So while this guide is written to help others learn, it's also a cheat sheet I’ll be bookmarking for my own Linux adventures. If you're learning too, we're in this together!

Let’s break it all down!

Linux_Directories


πŸ“š Table of Contents


πŸ“ / β€” Root Directory

What it is: The starting point of the entire Linux file system. Every other file and folder branches out from here.

Windows equivalent: C:\ (the main drive)


πŸ“ /home β€” User Home Directories

What it is: Where personal files for each user are stored. For example, your documents, downloads, and configs.

Windows equivalent: C:\Users\YourName\


πŸ“ /root β€” Root User’s Home

What it is: The home directory for the root (administrator) user.

Windows equivalent: Kind of like C:\Users\Administrator\


πŸ“ /etc β€” Configuration Files

What it is: System-wide configuration files for your Linux system and installed software.

Windows equivalent: A mix of C:\Windows\System32\ and the Windows Registry


πŸ“ /bin β€” Essential Binaries

What it is: Basic command-line programs needed to boot and run the system.

Windows equivalent: Think of this like C:\Windows\System32\ for basic command tools.


πŸ“ /sbin β€” System Binaries

What it is: System-level binaries (commands) for admin tasks, usually run by the root user.

Windows equivalent: Also similar to System32, but tools for system maintenance.


πŸ“ /usr β€” User Applications and Files

What it is: Secondary hierarchy for user-installed software, libraries, and documentation.

Windows equivalent: Like C:\Program Files\ or C:\Program Files (x86)\


πŸ“ /var β€” Variable Files

What it is: Files that change often, like logs, mail, or spool directories.

Windows equivalent: Like C:\ProgramData\ or C:\Windows\Logs\


πŸ“ /tmp β€” Temporary Files

What it is: Stores temporary files. Gets cleared on reboot.

Windows equivalent: Like C:\Windows\Temp\


πŸ“ /dev β€” Device Files

What it is: Represents hardware devices as files (yes, even USB drives).

Windows equivalent: Like Device Manager, but represented as files in a folder.


πŸ“ /proc and /sys β€” System Info

What it is: Virtual files that expose system and kernel info in real-time.

Windows equivalent: Similar to tools like Task Manager or System Information


πŸ“ /lib β€” Libraries

What it is: Shared libraries needed by binaries in /bin and /sbin.

Windows equivalent: Like .dll files in System32


🧠 TL;DR: Visual Comparison Table

Linux Directory Purpose Windows Equivalent
/ Root of file system C:\
/home User files C:\Users\
/root Admin user home C:\Users\Administrator\
/etc Config files System32 + Registry
/bin Essential commands System32 tools
/sbin Admin tools Advanced system tools
/usr User-installed apps Program Files\
/var Logs, mail, etc. ProgramData, Logs\
/tmp Temporary files Temp folder
/dev Hardware devices Device Manager
/proc / /sys System info Task Manager, System Info
/lib Shared libraries .dll files

Thanks for reading! If you're also learning Linux, I’d love to hear about your journey in the comments. Let’s learn together! πŸ’»πŸš€

πŸ’¬ Let’s Connect

https://www.linkedin.com/in/ltwilliams-tech/

Top comments (0)