logo
NotesNotesResumeResume
© 2026 Kiet Nguyen
← All notes
Surreal tree grown from slash — Linux root directory folders as a hierarchy of roles

Breakdown·March 25, 2026·9 min read

Linux root directory folders explained

Linux · Filesystem · Systems · Learning

A breakdown of the top-level tree under / : what each common name is for, which entries are real directories vs virtual filesystems vs compatibility links, and a one-line reference table you can re-check on any host.

/ is not a junk drawer. It is a layout of responsibilities: software, configuration, variable data, kernel-facing surfaces, and a few historical costumes so old paths still resolve.

This breakdown walks the common top-level names you see after ls -la /—what each role is, what often surprises people (merged /usr, size-0 virtual trees, swap as a file), and a scan table for when memory fails.

One-sentence crystal

The Linux root directory is the top of the filesystem tree: a set of conventional top-level paths that separate (roughly) boot, config, software, variable data, user homes, and kernel/device views—some real directories on disk, some virtual, some compatibility symlinks.


How to read an ls -la line

The listing is the primary source. FHS is the map that mostly matches it.

drwxr-xr-x  20 root root  4096 Jun 30 06:52 boot
FieldWhat to tell yourself
d / l / -Directory / symlink / regular file—type first
rwxr-xr-xWho can read/write/enter (owner, group, other)
link countDirectory link counts are easy to misread; do not over-claim
root rootOwner and group
sizeFor directories, often block size of the entry—not “how full is this tree”
mtimeWhen this entry last changed
nameThe label under /

. and .. are the most boring entries and that is fine: self and parent. On /, “parent” is a shrug; they matter for relative paths.


What each top-level name is for

. and ..

Self and parent. Useful for relative paths; not a place to overthink.


bin → usr/bin (often)

On many modern hosts, /bin is a symlink into usr/bin. Same story often for lib and sbin.

Role: historical path for essential commands so scripts that hardcode /bin/sh still work, while packages install under /usr. Merged /usr is a compatibility compromise with history—not a bug.

Trap: recovery modes where /usr is not mounted can feel more brittle on merged layouts. Do not teach “/bin is essential, /usr can be on NFS” as eternal 1998 law without checking this host.


boot

Kernels, initramfs, bootloader files. Serious “do not casually rm” energy is correct.

Role: early boot materials. A tiny full /boot partition that breaks upgrades is a meme because it is real.


cdrom

Traditional mount-point slot for optical media. Often empty on VMs with no drive—convention kept for predictability.


dev

Device nodes and special I/O objects: disks, ttys, null, serial adapters—paths you open.

Role: hardware and pseudo-devices as files. Permissions matter (e.g. serial groups). This is where “everything is a file” becomes a working method, not a sticker.


etc

Host-specific configuration: network, ssh, sudo, service units, fstab—machine identity and policy.

Role: settings that own this machine, as opposed to the bulk of installed software under /usr. Treat it as high-value and reviewable, not a one-off snowflake no one can reconstruct.


home

Ordinary users’ home directories—history, keys, clones, personal state.

Role: human territory. Long-lived services should not hide their only state only under one user’s home if multi-user and service accounts are the real design.


lib → usr/lib (often)

Same merged-/usr story as bin. Shared libraries and multiarch paths.

Role: libraries via historical paths even when bits live under /usr/lib. Compatibility is a kind of UI.


lost+found

Root-only area for fsck salvage after filesystem drama. Empty is good news.

Role: recovery orphans, not a decluttering bin. Files appearing here deserve investigation, not casual deletion.


media vs mnt

Not duplicates:

PathTypical role
mediaAutomount / “removable media appeared”
mntAdmin mount … /mnt/... on purpose

Predictable conventions beat inventing ad-hoc top-level trees in a hurry.


opt

Optional / third-party “whole tree” software outside the pure distro package map.

Role: vendor tarballs and self-contained app trees when isolation from package-manager purity is intentional.


proc (often size 0)

procfs—not a normal disk folder. The kernel answering questions through file-shaped doors: processes, memory, sysctls under /proc/sys.

Role: live process and kernel information as files. Great for observation; generated content is not your backup dataset. Prefer documented interfaces when stakes are high.


root (the user home, not /)

Home directory of the root user (UID 0), often mode 700.

English overloads “root” for UID 0, filesystem /, and /root. When someone says “check root,” ask: slash or home?


run

Early runtime state: PIDs, sockets, things that need to exist before /var is fully ready. Often tmpfs—reboot and it is gone.

Role: volatile runtime, not durable logs. On many hosts /var/run is a symlink into /run—verify rather than assume.


sbin → usr/sbin (often)

Admin-oriented tools via historical paths. Same merge story as bin.

Role: system tools; PATH and privilege are separate issues from “who is allowed to run this.”


snap (distro-specific)

Ubuntu-style packaging subplot as a top-level directory—not classic FHS purity.

Role: Snap mounts/data when the host uses Snap. Portable automation should not assume /snap exists on every Linux.


srv

Data for services this machine serves. Often empty.

Role: reserved parking for service content—not a failure when vacant.


swap.img (sometimes present)

Not a directory. A regular swap file (e.g. large, mode 600) on some Ubuntu-style installs.

Role: virtual memory as a file at / instead of only a dedicated partition. Easy to mistake for junk in a naive full-root backup—check swapon --show before strong feelings or deletes.


sys

sysfs: devices, drivers, buses, knobs. Virtual tree; size often 0.

Role: hardware and kernel objects as a browsable tree. Writing attributes can change real hardware state—read more than you write until you know the attribute.

If proc is “how does the kernel feel about processes and memory?”, sys is “what device/driver story does the kernel expose?”


tmp

World-writable scratch with a sticky bit (t): you can create files; you should not delete others’. Often tmpfs—fast and forgetful.

Role: shared temporary space. Full /tmp can break builds and tools. Secrets do not belong here.


usr

Bulk of installed userland: bins, libs, share, include. On merged systems this is the real city; bin/lib/sbin are street signs pointing downtown.

Role: mostly read-only software image, distinct from host config (etc) and variable data (var). /usr/local is often “installed outside the distro’s primary package brain.”


var

Logs, caches, package state—data that grows while the system runs.

Role: variable runtime data. Many “Linux is broken” moments are “/var is full.” Log rotation and disk layout are survival, not bureaucracy.


Map of responsibilities

Kernel-facing virtual   proc  sys  dev
Boot & machine local    boot  etc  root  (+ swap file, sometimes)
OS software bulk        usr   (+ bin/lib/sbin links)
Runtime & mutable       run   tmp  var  home  media/mnt/opt/srv

When operating a host, care which paths are ephemeral, which must persist, and which must not fill.


One-line reference table

PathOne-line explain
.This directory (/) itself.
..Parent entry of / (stays at root in normal navigation).
binOften symlink to usr/bin—essential commands via historical path (merged /usr).
bootKernels, initramfs, bootloader files for early boot.
cdromConventional mount point for optical media (often unused).
devDevice nodes and pseudo-devices for hardware and special I/O.
etcHost-specific system and service configuration.
homeOrdinary users’ home directories.
libOften symlink to usr/lib—shared libraries via historical path.
lost+foundfsck orphan recovery area (root-only).
mediaAutomount root for removable media.
mntAdmin temporary mount point for filesystems.
optOptional / third-party add-on software trees.
procVirtual procfs: processes and kernel info as files.
rootHome directory of the root user (not /).
runEarly, often tmpfs runtime state (PIDs, sockets).
sbinOften symlink to usr/sbin—system admin tools via historical path.
snapSnap package mounts/data (Ubuntu-style; distro-specific).
srvData for services hosted on this machine (often empty).
swap.imgSwap file used as virtual memory (not a directory; host-dependent).
sysVirtual sysfs: devices, drivers, kernel object tree.
tmpWorld-writable temporary scratch (sticky bit; often tmpfs).
usrMain installed userland: bins, libs, shareable read-mostly software.
varVariable runtime data: logs, caches, package/service state.

Closing

Think of / as a layout of responsibilities, with historical costumes and distro extras:

  1. proc / sys / dev — the kernel speaking in paths
  2. merged bin / lib / sbin — compatibility as design
  3. etc vs usr vs var — config vs software vs living data
  4. occasional swap.img at / — modern defaults can look weird and still be valid

FHS is a shared language, not eternal law on every host. Virtual filesystems are first-class literacy, not advanced trivia. One host’s layout is not portable Linux by itself.

Next time you land on a machine, run ls -la / as a health check of the model: if a name cannot be explained, that is the lesson—not a reason to look away.

Back to notes

Was this page helpful?