Linux File System
May 17, 2025
Unlike Windows with its drive letters (C:, D:, etc.), Linux organizes everything under a single root directory (/
). This might seem a bit strange at first, but trust me, there’s a logical and well-thought-out reason for this organization.

In this blog post, we will discuss through the essential directories you’ll find in a typical Linux system. We’ll explore why each folder exists, what kind of files it usually contains, and why this hierarchical structure is actually quite powerful and efficient. Think of it as learning the layout of a new city – once you understand the main districts, navigating becomes much easier!
Why everything under /
?
The single root directory (/
) in Linux is a fundamental design principle that promotes a unified and consistent way of accessing all files and resources on the system. Here’s why this approach is beneficial:
-
Everything is a File: In Linux, the philosophy is that “everything is a file.” This includes not just regular documents and applications but also hardware devices, processes, and even network sockets. The file system acts as a central point for accessing all these resources. Directories are simply special files that contain references to other files (including other directories).
-
Logical Organization: The hierarchical structure under the root directory provides a logical way to organize different types of files and data. This makes it easier for both the system and users to locate specific files and understand their purpose. It’s like organizing a house into different rooms based on their function (e.g., kitchen for cooking, bedroom for sleeping).
-
Mount Points: Integrating Storage: When you add new storage devices to a Linux system (like a USB drive or an external hard drive), you don’t get a new drive letter. Instead, you
mount
the file system of that device onto an existing directory within the main Linux file system tree. This makes the contents of the new storage device accessible as if they were part of the main system’s file structure. Think of it as adding a new bookshelf to our existing library – the books on the new shelf are still part of the same overall collection.

Essential Linux Directories Explained
Let’s explore the most important directories we’ll encounter under the root (/
) directory:
1. /boot
: The System’s Starting Point (Less Relevant in Containers)
- Why it exists: This directory holds all the essential files needed to boot our Linux system. Think of it as the launchpad for our operating system.
- What we’ll find:
- Kernel Images (
vmlinuz-*
): These are the actual files containing the Linux kernel, the core of the operating system. - Initial RAM Disk Images (
initrd.img-*
orinitramfs-*
): These are temporary file systems that contain essential drivers and utilities needed during the early stages of the boot process, before the main file system is mounted. - Bootloader Configuration (
grub/
orsystemd/
): This directory contains the configuration files for our bootloader (like GRUB), which is the first program that runs after the BIOS/UEFI and allows you to choose which operating system to boot (if you have multiple installed).
- Kernel Images (
- Why we need to know: While we won’t typically modify files in
/boot
directly, understanding its purpose is crucial for troubleshooting boot-related issues. In containerized environments, the boot process is often handled by the host system, making this directory less significant within the container itself.
2. /usr
: Userland’s Domain (Where Applications Live)
- Why it exists: The
/usr
directory is a major branch of the file system tree and contains the majority of user-installed applications, libraries, documentation, and other read-only data. It’s designed to be shareable across multiple users on the system. Think of it as the main application and resource center. - Key subdirectories:
/usr/bin
: Contains most of the executable programs that users typically run (e.g.,ls
,grep
,nano
)./usr/sbin
: Contains system administration and other privileged executable programs (e.g.,useradd
,ifconfig
). These usually require root privileges to run./usr/lib
(or/usr/lib64
on 64-bit systems): Holds shared libraries (.so
files) that are used by many different programs. These are like reusable code modules./usr/share
: Contains architecture-independent data such as documentation (/usr/share/doc
), man pages (/usr/share/man
), and icons (/usr/share/icons
).
- Why we need to know: You’ll frequently interact with programs located in
/usr/bin
. Understanding that user-installed applications generally reside under/usr
helps in locating them.
3. /var
: Variable Data’s Home (Logs, Caches, and More)
- Why it exists: The
/var
directory is where files that are expected to change frequently are stored. This includes logs, caches, spool directories (for printing or email), and temporary files that persist across reboots. Think of it as the system’s constantly changing storage area. - Key subdirectories:
/var/log
: Contains system log files that record various events, errors, and activities. This is our go-to place for troubleshooting system issues./var/cache
: Stores cached data for applications. Caching helps speed up application loading times./var/spool
: Holds data that is waiting to be processed, such as print jobs (/var/spool/cups
) or email queues (/var/spool/mail
)./var/tmp
: Similar to/tmp
but files here might persist across reboots (though they can still be deleted by system maintenance tasks).
- Why we need to know: You’ll often need to check log files in
/var/log
for troubleshooting. Understanding that frequently changing data resides in/var
is important for system administration.
4. /etc
: The Configuration Central
- Why it exists: The
/etc
directory is the central location for most system-wide configuration files. These files control the behavior of the operating system and various applications. Think of it as the system’s control panel. - What we’ll find: Numerous configuration files in plain text format (making them relatively easy to read and edit, though be careful!). Examples include network configuration (
/etc/network/interfaces
), user account information (/etc/passwd
,/etc/shadow
), system startup scripts (/etc/init.d/
or/etc/systemd/system/
), and configuration files for various installed applications (often in subdirectories within/etc
). - Why we need to know: You’ll frequently need to edit configuration files in
/etc
to customize our system and applications. Always make backups before modifying these files!
5. /home
: Your Personal Space
- Why it exists: The
/home
directory is the default location for user home directories. Each regular user on the system typically has their own subdirectory within/home
(e.g.,/home/ourusername
). This is where users store their personal files, documents, downloads, and user-specific application settings. Think of it as each user’s private room. - What you’ll find: A subdirectory for each user account. Inside a user’s home directory, you’ll typically find standard user directories like
Documents
,Downloads
,Pictures
,Music
, and often hidden configuration directories for individual applications (usually starting with a dot, like.config
or.mozilla
). - Why we need to know: This is where we’ll spend most of our time as a regular user, managing our personal files.
6. /opt
: Optional Add-ons
- Why it exists: The
/opt
directory is traditionally used for installing optional or third-party software packages that are not part of the standard distribution repositories. Think of it as a place for installing extra tools that aren’t part of the main set. - What we’ll find: Often, applications installed in
/opt
will reside in their own subdirectory (e.g.,/opt/google/chrome
). - Why we need to know: If we install software manually from a vendor’s website (not through the package manager), it might end up in
/opt
.
7. /srv
: Service Data (Less Common in Containers)
- Why it exists: The
/srv
directory is intended to hold data served by the system, such as website files for a web server (/srv/www
) or FTP server data (/srv/ftp
). Think of it as the storage for services provided by the system. - Why we need to know: If we’re running a server on our Linux machine, we might interact with
/srv
. In containerized environments, services often manage their data within the container’s own file system, making/srv
less commonly used.
8. /root
: The Administrator’s Home
- Why it exists:
/root
is the home directory for the root user, the superuser with administrative privileges. It’s kept separate from other user home directories for security reasons. Think of it as the administrator’s secure control center. - Why we need to know: You’ll only access
/root
when we are logged in as or usingsudo
to execute commands as the root user.
9. /tmp
: Temporary Playground
- Why it exists: The
/tmp
directory is used for storing temporary files that are typically deleted when the system is rebooted. Applications often use/tmp
to store temporary data during their operation. Think of it as a temporary scratchpad. - Why we need to know: You might occasionally need to clear out
/tmp
if we’re running low on disk space, though modern systems usually handle this automatically.
10. /run
: Runtime Data
- Why it exists: The
/run
directory (which replaced/var/run
on many modern systems) stores volatile runtime data for running processes. This includes things like process IDs (PIDs), sockets, and other transient information. Think of it as the system’s in-memory workspace for active processes. - Why we need to know: You won’t typically interact with
/run
directly as a regular user.
11. /proc
and /sys
: Virtual Worlds
- Why they exist:
/proc
and/sys
are special virtual file systems. They don’t actually store files on our hard drive. Instead, they provide a way to access information about running processes (/proc
) and the kernel and hardware (/sys
). Think of them as live information dashboards. - Why we need to know: These directories are invaluable for system monitoring and debugging. For example, we can find information about a specific process by looking at its directory under
/proc
.
12. /dev
: The Device Manager
- Why it exists: The
/dev
directory contains special files called device files. These files represent hardware devices connected to our system, such as hard drives (/dev/sda
,/dev/sdb
), USB drives (/dev/sdb1
), and even virtual devices like/dev/null
(a black hole for data) and/dev/random
(a source of random numbers). Remember our earlier point about “everything is a file”? This is a prime example! - Why we need to know: You’ll interact with
/dev
indirectly when we mount or unmount storage devices.
13. /mnt
and /media
: Mounting Points
- Why they exist: These directories are used as mount points for external file systems.
/mnt
is traditionally used for manually mounted file systems, while/media
is often used as the automatic mount point for removable media like USB drives and CDs/DVDs. Think of them as temporary docking stations for external storage. /data
(in our container example): In our specific container setup,/data
is likely a mount point that we explicitly created to link a folder on our Windows host system (C:/ubuntu-data
) into the container’s file system. This allows we to share files between our Windows environment and our Linux container.
Navigating the Linux Landscape:
Understanding this fundamental folder structure is a key step in becoming comfortable with Linux. While it might seem like a lot at first, with a little exploration, we’ll start to recognize the purpose of each directory and how they all fit together under the single root (/
). It’s a logical and efficient system that, once we grasp it, makes managing our Linux environment much easier. So, go ahead, open up our terminal and start exploring the branches of our Linux file system tree!
Things to Remember :
/ (root)
: The primary hierarchy for the entire file system./boot
: Contains files needed to boot the system./dev
: Contains device files that represent hardware components./usr
: Contains user-related programs and data./bin
: Contains essential user binaries (commands)./sbin
: Contains essential system binaries (commands)./home
: Contains home directories for users./lib
: Contains essential shared libraries for system binaries./tmp
: Contains temporary files./var
: Contains variable data like logs and caches./etc
: Contains system-wide configuration files./proc
: Contains virtual files that represent system and process information./usr/local
: Contains user-installed software./home/bob
and/home/alice
: Home directories for users Bob and Alice.