Table of Contents
Why the Filesystem Matters in Linux
In Linux, everything is organized inside a single tree that starts at the root directory, written as /. This is called the root filesystem.
There are no separate “drives” like C: or D: in Windows. All disks, partitions, USB sticks, and network shares are attached (mounted) somewhere under /.
This chapter gives you a big-picture view of that tree so you can make sense of paths you see in commands, documentation, and error messages.
You will later learn about specific important directories in their own chapter; here we stay at the “map level” and avoid deep dives into any single directory.
The Root Directory `/`
The top of the Linux filesystem is the root directory, written as a single slash: /.
Everything is located under /, for example:
/bin/home/etc/usr/var/dev/tmp/proc/sys- and many more…
There is no filename above /. If you see a path like /home/alex/file.txt, you can think of it as:
/→ roothome/→ a directory under rootalex/→ a subdirectory under/homefile.txt→ a file inside/home/alex
Basic Structure: The High-Level “Neighborhoods”
You don’t need to memorize everything at once. It helps to think of the root filesystem as grouped into a few main “neighborhoods”:
- System essentials (boot and core programs)
These are needed for the system to start and run at a basic level: /boot– files needed to boot the system (bootloader, kernel images)./bin– essential user commands needed in single-user or emergency mode./sbin– essential system administration commands./lib,/lib64– essential shared libraries used by programs in/binand/sbin.- User data and applications
/home– home directories for regular users./root– home directory for theroot(administrator) user./usr– most user-space software, libraries, documentation, etc./opt– optional, often third-party or self-contained software packages.- Configuration and variable data
/etc– system-wide configuration files./var– variable data that changes over time (logs, caches, mail queues, etc).- Temporary storage
/tmp– temporary files, usually safe to delete and often cleaned automatically.- Devices and virtual filesystems
/dev– special files representing hardware and virtual devices./proc– virtual filesystem exposing process and kernel information./sys– virtual filesystem exposing kernel and device information./run– runtime data (like PID files, sockets) valid only while the system is running.- Mount points
/mnt– traditionally used for temporarily mounting filesystems./media– typically used for removable media (USB drives, CDs, etc.).- Other mount points can be anywhere (for example
/srv/dataor/data).
You will meet many of these directories again in their own subchapters later.
Filesystem Hierarchy Standard (FHS)
Most Linux distributions follow a common guideline called the Filesystem Hierarchy Standard (FHS). FHS describes:
- Which top-level directories should exist under
/. - What they are generally used for.
- Some rules about what goes where (for example: configuration in
/etc, logs in/var/log).
Not all distributions follow FHS perfectly, but the broad structure is similar enough that once you learn it on one distribution, you can navigate most others.
How the Tree Works: An Example Path
Consider the path:
/usr/share/doc/bash/README
Breaking it down:
/– root directoryusr– directory under/share– directory under/usrdoc– directory under/usr/sharebash– directory under/usr/share/docREADME– file inside/usr/share/doc/bash
Conceptually, this is exactly like nested folders in a graphical file manager, but represented as a single string with / separators.
Multiple Filesystems, One Tree
On many systems, different parts of the tree live on different partitions or disks, but they are all still seen as one tree under /.
For example, a system might be organized like:
- Root filesystem
/on one disk partition /homemounted from a separate partition/booton its own small partition/mnt/backupmounted from an external disk
From a user’s perspective, paths still look like:
/home/alex/Documents/boot/vmlinuz-.../mnt/backup/photos
You don’t see “drives” changing; you just move around one big tree.
System vs. User Areas
A key concept in the root filesystem is the distinction between “system-owned” areas and “user-owned” areas:
- System-owned (managed by the OS and package manager)
- Typically:
/bin,/sbin,/lib*,/usr,/etc,/varand others. - You normally need
sudo(administrator privileges) to change files here. - You avoid manually editing or adding files here unless you know what you’re doing.
- User-owned (where you freely create and edit files)
- Typically: your home directory, e.g.
/home/yourname. - Inside your home directory you can create whatever structure you like:
/home/yourname/Documents/home/yourname/Projects- etc.
There are also “shared” or “service” areas like /srv, which are intended for data provided by services (e.g., web or FTP servers), usually managed by an administrator.
Viewing the Root Filesystem
Once you have a terminal, you can look at the top level of the filesystem:
ls /You will typically see something like (contents vary by distribution):
bin boot dev etc home lib lib64 media mnt opt
proc root run sbin srv sys tmp usr varYou can then explore, for example:
ls /home
ls /etc
ls /varAt this stage, you don’t need to understand everything you see. The goal is to become familiar with the layout and recognize the common top-level directories.
Summary: What to Take Away
- The root filesystem starts at
/and contains everything on the system. - There are no
C:andD:drives; all storage is mounted somewhere under/. - The tree is organized into logical areas: system essentials, user data, configuration, logs, temporary data, devices, and mount points.
- Most distributions follow the Filesystem Hierarchy Standard, so once you learn this layout, it applies almost everywhere.
- As a regular user, most of your daily work will happen inside your home directory under
/home, but understanding the rest of the tree helps you interpret documentation, error messages, and admin commands.
In the next chapters, you’ll examine specific important directories under / in more detail.