Table of Contents
How to Think About “Important” Directories
You’ve already seen the big idea of the Linux filesystem (single root /, everything is a file). Here, the goal is to get a practical mental map of the directories you’ll touch most often as a beginner, and what kinds of things you can expect to find there.
Think of this as a “tour” of the standard layout: not every tiny detail, just enough to know where to look and what not to break.
We’ll focus on:
- High‑impact top‑level directories beginners actually meet
- What lives there
- Typical tasks you’ll do with them
- Things you should be cautious about
Subdirectories like /home, /etc, /var, etc. have their own chapters; here we’ll place them in context and cover other key directories briefly.
The Root Directory `/`
Everything on a Linux system lives somewhere under /.
At the top level, you’ll commonly see directories such as:
/bin/boot/dev/etc/home/lib,/lib64/media,/mnt/opt/proc/root/run/sbin/srv/sys/tmp/usr/var
Your desktop file manager or terminal ls / will show you these.
You don’t need to memorize them all at once. It’s more useful to know what kind of stuff goes in each, so the names start to make sense.
`/bin` — Essential User Commands
- Contains basic user commands needed for the system to function in single‑user or “rescue” modes.
- Typical commands here:
ls,cp,mv,rm,cat,echo,pwd,mkdir,rmdir- Simple shells like
sh(or a symlink tobash)
What this means for you:
- When your system is in a minimal state (e.g., during early boot or recovery), commands in
/binare expected to be available. - As a user, you rarely put anything into
/bin; package managers handle that.
Note: On modern systems, /bin may be merged with /usr/bin (they can be the same directory via symlink), but the idea remains: core user commands.
`/sbin` — System Administration Commands
- “System binaries”: commands used mainly by administrators, especially for system startup, shutdown, and maintenance.
- Typical commands:
fsck,mount,umount,reboot,shutdown- Network tools like
ip(on some distros) - Service management tools on older systems (e.g.,
iptables)
You normally run these via sudo, because many of them change system-wide settings.
As a beginner:
- You will run tools from
/sbin(often without realizing it). - You should not manually add or remove files here.
`/boot` — Boot Loader and Kernel Files
- Contains files needed to start the operating system:
- The Linux kernel (
vmlinuz-*) - Initial RAM filesystem images (
initrdorinitramfsfiles) - Bootloader files (e.g., GRUB configuration,
grub.cfgon many systems)
Why it matters:
- If
/bootis damaged or full, your system may not boot. - You rarely modify
/bootmanually; package updates (especially kernel updates) take care of it. - If you manage multiple kernels, you may see several kernel versions and initramfs files here.
As a beginner, treat /boot as look but don’t touch, unless following specific instructions.
`/dev` — Device Files
- Holds special files that represent devices:
- Disks and partitions:
sda,sda1,nvme0n1p1, etc. - Terminals:
tty0,tty1,pts/* - Random number generators:
random,urandom - Audio devices, USB devices, etc.
Key points:
- These are not regular files; they’re interfaces to hardware or virtual devices.
- Commands like
lsblk,fdisk -l(as root) help you see disks, many of which appear under/dev.
Practical example:
- When mounting a USB drive, you might mount
/dev/sdb1to/mnt/usb.
You do not create or delete these manually; udev and the kernel manage them.
`/etc` — System Configuration
(Has its own detailed chapter; here’s the position in the bigger picture.)
- Stores system-wide configuration files:
- Network settings, service configs, system defaults.
- Examples:
/etc/hosts,/etc/fstab,/etc/passwd,/etc/ssh/sshd_config.
As a beginner:
- When you “edit a config file,” it will almost always be in
/etcor a subdirectory of it. - Modifying files here usually affects all users on the system.
Be cautious: syntax errors in /etc configs can break services or even prevent login/boot.
`/home` — Users’ Home Directories
(Covered in depth in its own chapter.)
- Each regular user gets a subdirectory:
/home/alex,/home/jamie, etc.- This is where you store personal files and settings, documents, downloads, etc.
It’s your space:
- Most of your work, projects, and custom configs (
.bashrc,.config/) live here. - Backing up
/homeis often enough to protect user data and personal configuration.
`/lib`, `/lib64` — Shared Libraries
- Holds shared libraries needed by programs in
/binand/sbin(and others). - On 64‑bit systems, you often see both
/liband/lib64.
Conceptually similar to:
.dllfiles on Windows.dylibon macOS
As a beginner:
- You almost never edit files here manually.
- Package managers install and upgrade shared libraries.
- If a program complains about a “missing library,” the file is usually under
/lib,/lib64, or/usr/lib.
`/media` and `/mnt` — Mount Points
These are places where other filesystems get attached (mounted) into the main tree.
`/media`
- Used by the system to auto-mount removable media:
- USB sticks, external hard drives, SD cards, etc.
- You may see paths like:
/media/username/MyUSBDrive
Usually managed automatically by your desktop environment.
`/mnt`
- A more generic mount point for temporary or manual mounts.
- Often used in examples and sysadmin tasks:
sudo mount /dev/sdb1 /mnt
For beginners:
- Use whichever your distro or instructions suggest.
- Don’t delete these directories; they’re part of the standard layout.
`/mnt` vs `/media` vs Other Mount Points
You may also see custom mount points in other locations, e.g.:
/srv/wwwfor a web server’s content/dataor/backupcreated by admins
The core idea:
- Mount points are just folders where other filesystems appear.
- The data actually lives on a device (like
/dev/sdb1) or network share, but becomes accessible somewhere like/mnt/usb.
`/opt` — Optional Add‑On Software
- Intended for third-party or “optional” software not managed by the main package system.
- Common uses:
- Large, self-contained applications (e.g., commercial software, some games, IDEs).
- Some software from vendor installers may go into
/opt/vendor/app.
For a beginner:
- If you manually install a program from a
.tar.gzor vendor installer, check whether it ends up in/opt. - You generally don’t create random files here; follow software instructions.
`/proc` — Pseudo Filesystem for Processes and Kernel Info
(Covered more in its own later chapter, but here’s where it fits.)
- A virtual filesystem representing kernel and process information.
- Files here are generated on the fly; they don’t exist on disk.
- Examples:
/proc/cpuinfo,/proc/meminfo— hardware and memory info/proc/1234/— info about process with PID 1234
Typical beginner uses:
- View system info:
cat /proc/cpuinfocat /proc/meminfo- Tools like
top,psread from/procinternally.
You don’t edit files here unless following very specific, advanced instructions.
`/root` — Home Directory for the Root User
- The root user’s home (administrator account), not the root of the filesystem.
- Path:
/root(not/).
Why separate?
- Keeps the administrator’s files out of regular users'
/homedirectory. - Useful when
/homeor other partitions aren’t available (root must still have a working home).
As a beginner:
- You usually won’t work directly in
/root. - If you log in as root (not recommended generally), your home directory becomes
/root.
`/run` — Volatile Runtime Data
- Contains runtime information for processes and system services:
- PID files (
*.pid), socket files, temporary state for services. - Lives in RAM (tmpfs) on many systems; contents vanish on reboot.
For example:
/run/systemd/— systemd runtime info/run/user/1000/— per-user runtime data
Typically, you won’t manipulate /run directly. Tools and services manage it automatically.
`/srv` — Service Data
- Stands for “service.”
- Intended to hold data served by the system:
- Web server data:
/srv/www - FTP server data:
/srv/ftp - Usage varies by distribution and admin preference; on many desktop systems it may be mostly empty.
If you later run a server, you may see /srv used as the root for service content.
`/sys` — Sysfs: Kernel Device and System Info
(Also expanded later in its own chapter.)
- Another virtual filesystem exposing kernel objects and devices.
- Reflects current state of hardware and drivers.
- Examples:
/sys/class/net/— network interfaces/sys/block/— block devices (disks)
Typical usage for beginners is indirect:
- Tools like
udevadm,lsusb,lspcimay read data here. - Some advanced tweaks are done by writing to certain
/sysfiles (often only temporarily).
As a new user, treat /sys as read-only unless you’re following careful documentation.
`/tmp` — Temporary Files
- Used for temporary files created by programs and users.
- Often cleaned up at boot, or periodically.
- Permissions usually allow all users to create files here (
/tmpis world-writable with “sticky bit”).
As a beginner:
- Safe place for disposable work:
- Temporary downloads
- Extracted archives you don’t care about keeping
- Don’t rely on
/tmpfor long-term storage; files can disappear without warning.
`/usr` — User-Space Programs and Data
This is one of the largest and most important trees.
Conceptually:
/holds the minimal tools to boot./usrholds the main body of user-space software and data.
Inside /usr, you’ll commonly see:
/usr/bin— most user commands/usr/sbin— additional system administration utilities/usr/lib,/usr/lib64— libraries for binaries in/usr/binand/usr/sbin/usr/share— architecture-independent data (documentation, icons, locales)/usr/local— locally installed software (not managed by the distro’s packages)
For you:
- When you install packages from your distribution, programs usually go into
/usr/binand friends. /usr/local/is often used by “from source” installs (e.g.,make installby default may target/usr/local).
You normally don’t change files in /usr manually; the package manager is responsible for this area.
`/var` — Variable Data
(Has its own dedicated chapter; here is the high-level idea.)
- Contains variable (changing) data:
- Logs:
/var/log/ - Caches:
/var/cache/ - Spools:
/var/spool/(print jobs, mail queues) - Databases, web content or other data that grows over time (depending on setup)
Common issues:
- If
/varfills up, services may stop working or the system may misbehave. - System monitoring and log viewing often focus on
/var, especially/var/log.
How to Use This Knowledge in Practice
You don’t need to remember every detail. More useful is to:
- Recognize the pattern of what lives where:
- Binaries:
/bin,/sbin,/usr/bin,/usr/sbin - Configs:
/etc - User data:
/home - Logs and variable data:
/var - Temporary:
/tmp,/run - Devices and kernel info:
/dev,/proc,/sys - Optional/third-party:
/opt - Mount points:
/mnt,/media, sometimes/srv - Be cautious in system directories:
- Don’t delete or move things under
/bin,/sbin,/lib*,/usr,/etcunless you know why. - Do your experiments and projects under your home directory, e.g.
/home/yourname/projects. - Use commands to explore (read-only at first):
ls /to see top-level directoriesls /etc,ls /usr/bin | headfor a taste of what’s insidedu -sh /var/*(withsudoif needed) to see which subdirectories use space
Over time, these directories will stop being mysterious labels and start to feel like familiar neighborhoods in a small city.