Table of Contents
Why the Linux Filesystem Feels “Different”
If you come from Windows or macOS, Linux’s filesystem layout looks unfamiliar at first. There is:
- No
C:\drive — instead there is a single tree that starts at/. - No separate “drive letters” – disks and partitions are attached (mounted) into the one tree.
- Special-purpose directories like
/etc,/var,/usrinstead of “Program Files” or “Users”.
This chapter gives you a big-picture tour of that tree and what makes Linux’s layout unique, without going into the finer details that are covered by the subchapters.
The goal: when you see a path like /etc/ssh/sshd_config or /var/log/syslog, you should immediately have a rough idea what kind of thing it is and why it lives there.
The Single Root: `/`
Linux organizes everything into a single directory tree that starts at the root directory, written as a single slash: /.
Some important consequences:
- There is no concept of separate “root folders” per disk.
- Additional disks, partitions, and even network storage are mounted as subdirectories of
/(for example/mnt/dataor/home), rather than becoming new drive letters. - Many things that aren’t even files in the traditional sense (like hardware devices or system information) still appear as files under
/dev,/proc,/sys, and so on.
You will see paths written like:
/– the root of the filesystem tree/home/alex/Documents– a specific file or directory under root/usr/bin/bash– another full path starting at/
These are absolute paths (more on that in the dedicated paths chapter).
Standardization: FHS and Why Layout Matters
The Linux filesystem layout is not random. It is largely guided by the Filesystem Hierarchy Standard (FHS), a document that describes what should go where.
Most major distributions roughly follow the same rules:
- Config files live in
/etc - User data goes in
/home - Executable programs go into
/usr/bin,/bin,/usr/sbin,/sbin - Logs and variable data go into
/var - Temporary files go into
/tmp - Device files live in
/dev
This consistency means:
- Skills transfer between distributions.
- Documentation and tutorials can refer to standard paths.
- System tools “know” where to look for things.
Some distributions slightly vary (for example, some merge /bin into /usr/bin), but the overall structure and purpose of each major directory stay similar.
“Everything Is a File”
A core Linux idea is that “everything is a file” (or looks like one):
- Regular text or binary files are files.
- Directories are special files containing lists of filenames.
- Devices (like disks or serial ports) appear as files under
/dev. - Kernel and process information appears as “files” under
/procor/sys.
This uniform view lets you interact with many different things using the same tools:
cat,less,cp,rmwork on many kinds of filesystem entries.- Programs read configuration from text files, instead of from opaque registries.
You will learn about the exact file types (regular, directory, link, etc.) in the dedicated File types chapter; here it’s important to understand that the filesystem is more than just “documents and programs”.
High-Level Directory Map
Here is a conceptual map of what sits directly under / and what kinds of things you can generally expect to find there:
/
├── bin - Essential user commands (often now linked into /usr/bin)
├── boot - Files needed to start (boot) the system (kernel, bootloader)
├── dev - Device files (disks, terminals, etc.)
├── etc - System-wide configuration files
├── home - Users’ personal directories and files
├── lib - Essential shared libraries (often merged with /usr/lib)
├── media - Mount points for removable media (USB drives, CDs)
├── mnt - Temporary mount points for manually mounted filesystems
├── opt - Optional/add-on software
├── proc - Virtual filesystem exposing process and kernel info
├── root - Home directory for the root user
├── run - Volatile runtime data (like PID files, sockets)
├── sbin - Essential system binaries (admin tools)
├── srv - Data for specific services (web server, FTP, etc.)
├── sys - Virtual filesystem for hardware and kernel interfaces
├── tmp - Temporary files (cleared regularly)
├── usr - Userland programs, libraries, documentation
└── var - Variable data (logs, caches, mail, etc.)You do not need to memorize this all at once. Focus first on the directories you will touch frequently as a normal user:
/home– your personal files/etc– system-wide configuration/var– logs and variable data/usr– most installed programs and libraries/tmp– temporary storage
Each of these will be covered in their own subchapters.
Separation of Concerns: Why Files Live Where They Do
The layout is designed to separate different kinds of data. This becomes important for:
- Backups
You usually back up user data (/home) and key configurations (/etc), not the whole system. - System upgrades
Systems can be upgraded or even reinstalled while keeping/homeintact. - Security
Permissions and policies differ: config files, system binaries, and user data are not all treated the same. - Multi-user systems
Each user has their own area (/home/username) without interfering with system files.
Some important distinctions you’ll encounter:
- System vs. user data
- System files:
/bin,/sbin,/lib,/usr,/etc - User data:
/home, sometimes under/srv(for services) - Static vs. variable data
- Static (rarely changes after installation): programs under
/usr/bin, libraries under/usr/lib - Variable (changes constantly): logs and caches in
/var, runtime data in/run, temp data in/tmp - Global vs. per-user config
- Global system config:
/etc/ - Per-user config: dotfiles in your home directory, like
~/.bashrc,~/.config/...
You’ll see this pattern again and again: what something is determines where it lives.
Root vs. User Space
Two “worlds” coexist in the same filesystem tree:
- System (root) space
Directories like/bin,/sbin,/usr,/etc,/varmostly require administrative privileges to change. Regular users can read many of these files but cannot freely modify them. - User space
/home/usernamebelongs to each user. You have full control over your own files (subject to disk space and system policies).
The root user (administrator) has its own home directory, typically /root. This is separate from normal users’ homes in /home and is meant only for administrative work.
Virtual Filesystems: `/proc`, `/sys`, and Friends
Some top-level directories are not stored on disk at all. They are virtual filesystems that expose live system state:
/proc
Provides process information and some kernel parameters. For example:/proc/cpuinfo– info about your CPU/proc/uptime– how long the system has been running/sys
Exposes detailed information about hardware devices and kernel subsystems./dev
Represents devices (like disks) as special files (e.g./dev/sda,/dev/tty).
From a user’s perspective, these behave like directories full of files. Under the hood, the kernel dynamically generates their contents when you read them.
This design allows system tools to use standard file operations (open, read, write) for monitoring and configuration.
Mount Points and Extra Storage
Linux has one unified tree, but you can still have multiple disks and partitions. They are integrated via mount points:
- A mount point is simply a directory.
- When you “mount” a filesystem (from a disk, partition, network share, or USB drive) into that directory, its contents appear there.
Common places where filesystems are mounted:
/– the root filesystem is mounted here./home– often on its own partition./boot– sometimes separate (for boot files)./media/username/or/run/media/username/– for auto-mounted USB and external drives./mnt– a general-purpose place for manual mounts.
Conceptually:
- There is always a root filesystem at
/. - Additional storage “branches” are attached somewhere under
/.
Understanding this helps you interpret paths when exploring new systems and documentation.
Filesystem Hierarchy and Permissions
The hierarchy and Linux permissions model are closely related:
- System critical directories (
/bin,/usr,/sbin,/etc,/boot) are usually writable only byroot. - User directories under
/homeare owned by each user. - Temporary directories like
/tmpoften allow any user to create files, but in a controlled way.
You will learn the details of permissions, ownership, and sudo later; for now, know that:
- Where a file is located often signals who is expected to control it.
- Changing files in system directories usually requires elevated privileges.
Orientation Tips for Beginners
When you log into a Linux system and open a terminal:
- Your current directory is usually your home directory, for example:
/home/alex- The shorthand for this is
~. - System configuration lives in
/etc. If a guide tells you “edit the config file”, it often means a file under/etc. - Installed programs usually live under
/usr/bin, but you don’t need to remember exact paths to run them — they are found via the environmentPATH. - Logs when “something went wrong” often live under
/var/log. - Avoid manually editing or deleting things under:
/bin,/sbin,/usr,/lib,/boot,/dev,/proc,/sys
unless you know exactly what you’re doing.
You will become familiar with the hierarchy naturally through regular use, system updates, and following tutorials.
How This Fits with the Next Chapters
In the subchapters that follow, you will:
- Explore the purpose and contents of
/home,/etc,/var,/usr,/tmp,/dev,/proc, and/sysin more detail. - Learn about file types (regular files, directories, links, device nodes, etc.) and how they appear in this hierarchy.
- Understand absolute vs relative paths and how to navigate the tree efficiently from the command line.
This chapter is your mental map of the territory; the next ones will zoom in on each region.