Subscribe to Our Newsletter

Success! Now Check Your Email

To complete Subscribe, click the confirmation link in your inbox. If it doesn’t arrive within 3 minutes, check your spam folder.

Ok, Thanks

An Introduction to Linux Filesystem Layout: Where Everything Lives

Understand why Linux organizes files differently.

Oyinebiladou Omemu profile image
by Oyinebiladou Omemu
An Introduction to Linux Filesystem Layout: Where Everything Lives
Photo by Lukas / Unsplash

If you're coming from Windows or macOS, Linux’s filesystem might seem confusing at first. Instead of drive letters (like C:\) or neatly hidden system folders, Linux uses a single, unified structure starting from the root directory (/). Everything, from your files to system configurations, branches out from here in a logical (but sometimes overwhelming) way.

This design is built for stability, flexibility, and multi-user support. Need to troubleshoot a crashing service? The logs are in /var/log. Installing software manually? It might go to /opt. Every directory has a purpose and knowing where things live can save you from blind changes.

So, here's everything you should know about the Linux folder structure.

How to install and remove software on Linux
It can help keep your system up-to-date and running smoothly.

1. / – Root Directory

This is where the entire filesystem begins. Every file, folder, and device traces back to “/”. Unlike Windows (where “C:\” is one drive and “D:\” is another), Linux treats all storage as branches of “/”. Even if you have multiple hard drives, they’re mounted (attached) to subdirectories here, making everything accessible under one hierarchy.

If you want to see what is in your root directory, run ls / This should show all your directories mounted to the root.

2. /bin & /sbin – Essential System Commands

  • /bin holds fundamental tools like ls, cp, rm, bash, grep, mkdir, etc. All the essential commands and utilities every user need, even in emergencies (like when the system can’t fully boot), are in this directory.
  • /sbin contains administrative tools like sudo, fdisk, reboot, etc, meant for the root user. Regular users can’t run these by default because they affect the whole system. For instance, if you want to install a system-wide application, you'll need to use sudo, which would require admin authentication.

These directories are split as a security measure. Critical system repairs often require booting into a minimal environment where only /bin is available.  

3. /etc – Configuration files

This is where Linux stores configuration files like settings for users, services, and applications. Files like:  /etc/passwd (user accounts),  /etc/fstab (disk mounts), and /etc/network/ (network settings), stored here.

If you want to check your Linux distro, you can do it from the /etc directory by running "cat /etc/os-release"

Changing a file in the /etc directory can alter how your system behaves. For example, editing /etc/ssh/sshd_config tweaks your SSH server. So, you might want to be very careful with the changes made here. 

4. /dev – Device Files

Linux represents every device, from keyboards, disks, even virtual terminals, as files in /dev. For example:  /dev/sda (your first hard drive), /dev/null (a "black hole" that discards data), and /dev/random (generates random numbers).  

This design lets you interact with hardware using standard file operations. If you need to wipe a USB drive, you could write zeros directly to /dev/sdb.  

5. /proc & /sys – Virtual Filesystems

These aren’t real folders, they’re virtual filesystems created on-the-fly by the kernel.  

  • The /proc directory exposes running processes and system stats. For example, /proc/cpuinfo contains CPU details. And /proc/meminfo contains memory usage. 
  • The /sys directory provides low-level hardware and kernel settings, like network interfaces, power management controls, etc. You can change or adjust system behavior by editing files here (e.g., adjusting screen brightness in /sys/class/backlight/).

6. /home – Your Personal Files 

Each user gets a subdirectory here (e.g., /home/alice). This is where your Documents, Downloads, Application settings, etc., live.

Unlike Windows, Linux strictly separates user files from system files, so you can’t accidentally break the OS by deleting the wrong folder.  

7. /tmp – Temporary files

A shared space for temporary files. The files stored here are automatically cleared on reboot. All users can write here (but can’t delete others' files) as well. When you make downloads from web browsers, they are temporarily stored here. When writing files, avoid keeping important files in this directory, as they might vanish. 

Linux vs. MacOS vs. Windows OS: Which Is Best for Developers?
Choosing the best OS for development depends heavily on what you’re building and how you prefer to work.

Conclusion

The Linux filesystem may seem complicated, but understanding it is essential for knowing how the operating system works. By knowing where files live and why they’re organized the way they are, you can easily play around and make changes in your system. 

If you need to troubleshoot a break, you can just check /var/log. If you’re running out of disk space, you can navigate to /home and /var to take a look. This structure is designed for efficiency, security, and flexibility. Once you understand it, you get full control over your chosen operating system. 

Image Credit: Oyinebiladou Omemu/techloy.com

Oyinebiladou Omemu profile image
by Oyinebiladou Omemu

Subscribe to Techloy.com

Get the latest information about companies, products, careers, and funding in the technology industry across emerging markets globally.

Success! Now Check Your Email

To complete Subscribe, click the confirmation link in your inbox. If it doesn’t arrive within 3 minutes, check your spam folder.

Ok, Thanks

Read More