/) tree, and each top-level folder has a job. Learn the ten that matter and you can troubleshoot, manage, and break things on purpose with a lot more confidence.New to Linux? The file system can look like a wall of cryptic two-letter folders the first time you ls /. Windows hands you drive letters (C:, D:, E:). Linux hands you one tree. Everything, and I mean everything, lives somewhere under the root (/) directory, including your USB stick, your CPU info, and the password file.
Every folder under / has a job. Once you know what each one is for, troubleshooting stops feeling like guesswork. I’ve poked through these directories on Debian 12 and Ubuntu 22.04 servers for years, so here’s the tour I wish someone had given me on day one. Ten directories. What they do, what’s inside, and why you should care.
1. / - The Root Directory
What it does:
- The root directory (
/) is the top of the Linux file tree. Every file, folder, and mounted device hangs off of it somewhere. - It’s the base that holds every other directory.
Why it matters:
- Windows scatters programs and data across drives. Linux puts the whole system under
/. - The installer builds this layout for you. You don’t create it by hand.
- Delete or corrupt the wrong thing inside
/and your system stops booting. Be careful up here.
2. /home - User Home Directories
What it does:
/homeholds a personal directory for every user account on the system.- If your username is
john, your stuff lives in/home/john/.
What’s inside:
- Personal files: Documents, downloads, pictures, music, videos.
- Configuration files: Hidden “dotfiles” like
.bashrcor.profilethat hold per-user settings. - User-specific app data: Folders like
~/.config/and~/.local/share/.
Why it matters:
- Windows hides user data in
C:\Users\. Linux keeps it clean inside/home. - Put
/homeon its own partition and you can wipe and reinstall the OS without losing your files. Worth doing on any serious build.
3. /root - The Root User’s Home Directory
What it does:
/rootis the home directory for the root user, the superuser who can do anything.- It sits separate from regular accounts (
/home/username/).
What’s inside:
- Root’s personal config files and dotfiles.
- Admin scripts and commands that only root should run.
Why it matters:
- Regular users can’t read or write
/root. That’s the point. It keeps daily-driver accounts away from things that can hose the system. - If you ever log in as root (don’t, use
sudo), this is your home.
4. /etc - System Configuration Files
What it does:
/etcholds the system-wide configuration files that tell Linux and its services how to behave.- Almost every service you install drops a config here.
What’s inside:
- Network settings:
/etc/network/interfacesor/etc/netplan/for network config,/etc/hostsfor local hostnames. - User accounts:
/etc/passwdfor accounts,/etc/shadowfor password hashes. - Service configs:
/etc/ssh/sshd_config,/etc/fstabfor mounts, firewall rules, web server configs, the lot.
Why it matters:
- If a service is misbehaving, the answer is almost always in
/etc. - Edit the wrong line in the wrong file and you can lock yourself out or refuse to boot. Back up the file before you touch it:
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.
5. /bin and /sbin - Essential System Programs
What they do:
/bin(binaries) and/sbin(system binaries) hold the core programs that make Linux usable.- Heads up: on modern Debian, Ubuntu, and most distros,
/binand/sbinare symlinks to/usr/binand/usr/sbin. Same files, different paths. Runls -l /binand you’ll see the link.
What’s inside /bin:
- Basic commands every user needs:
ls(list files)cp(copy files)rm(remove files)cat(view file contents)
What’s inside /sbin:
- Admin commands, usually root-only:
shutdown(turn off the system)fdisk(partition disks)iptables/nft(firewall rules)
Why they matter:
- These are the tools the system itself needs to boot and recover.
- Lose
/binand you can’t runls. You’re in single-user-mode-with-a-rescue-USB territory.
6. /var - Variable Data (Logs, Caches, Databases)
What it does:
/varholds files that change all the time: logs, caches, mail queues, package data, database files.
What’s inside:
- Logs:
/var/log/holdssyslog,auth.log,journal/, service-specific logs. - Web roots:
/var/www/is the default home for Nginx and Apache sites. - Spools:
/var/spool/holds print queues and mail. - Package data:
/var/lib/and/var/cache/apt/hold dpkg and apt state.
Why it matters:
- Server acting weird? Start in
/var/log/. The answer is almost always in there. Runsudo journalctl -xeorsudo tail -f /var/log/syslogand read. - Fill
/varand things break in ugly ways. Runaway logs can crash databases, web servers, and mail. Watchdf -h /varon any box that’s been up a while.
7. /usr - User-installed Programs and Libraries
What it does:
/usrholds the bulk of installed software, the libraries those programs need, and shared system data.
What’s inside:
/usr/bin/: Most of the commands you actually use day-to-day (nano,git,vim)./usr/sbin/: Non-essential admin tools./usr/lib/: Shared libraries the binaries depend on./usr/local/: Software you install by hand outside the package manager. Anything you compile from source usually lands in/usr/local/bin/.
Why it matters:
- Installed a tool from source and can’t find it? Try
/usr/local/bin/. - The split between
/binand/usr/binwas historical. With usrmerge, the distinction is mostly cosmetic on modern systems.
8. /tmp - Temporary Files
What it does:
/tmpholds scratch files that the system wipes on reboot. Some distros also wipe files older than 10 days viasystemd-tmpfiles.
What’s inside:
- Whatever apps and users decide to drop there: download fragments, session data, sockets, scratch files.
Why it matters:
- Great for one-off testing, scratch tarballs, anything you don’t care about.
- Don’t put real files here. They will disappear. I have watched more than one person lose a script they “saved real quick” to
/tmp.
9. /mnt and /media - Mount Points for External Drives
What they do:
- Both directories are mount points for drives that aren’t part of the root filesystem: USB sticks, extra hard drives, NFS shares, ISOs.
What’s inside:
/mnt/: Generic spot for manual mounts. Make a subfolder and mount whatever you want there./media/: Where desktop environments auto-mount removable drives (e.g.,/media/yourusername/USB_NAME).
Why they matter:
- On a server with no desktop, almost everything you mount lands in
/mnt/because you put it there. - Plug in a USB drive and nothing shows up in
/media/? You’re on a headless box. Mount it by hand.
Example:
sudo mkdir -p /mnt/usb
sudo mount /dev/sdc1 /mnt/usb
Use lsblk first to find the right device name. Don’t guess.
10. /dev, /proc, and /sys - System and Hardware Information
These three are virtual filesystems. Nothing in them lives on disk. The kernel builds them on the fly.
/dev/ - Device Files
- Files that represent hardware:
/dev/sda,/dev/sdb, etc. for SATA and USB disks/dev/nvme0n1for NVMe drives/dev/tty*for terminals/dev/nulland/dev/zerofor the classic Unix tricks
/proc/ - Process and Kernel Information
- Live system info, regenerated by the kernel:
/proc/cpuinfofor CPU details/proc/meminfofor RAM usage/proc/<pid>/for everything about a running process
/sys/ - Kernel and Hardware Settings
- A structured view of devices, drivers, and kernel knobs you can read and sometimes write to.
Why they matter:
- Need CPU info without installing anything?
cat /proc/cpuinfo. - Looking for the right disk to format?
lsblkreads from/sysand tells you exactly what’s there. /dev/is how you talk to hardware. Mount commands,dd,fdisk, every one of them points at/dev/paths.
Wrapping Up
The Linux file system looks like alphabet soup until you understand what each folder is for. Then it stops being scary. You’ll know that logs live in /var/log, configs live in /etc, your stuff lives in /home, and the kernel exposes hardware through /dev, /proc, and /sys.
Best way to lock it in? Go look. Open a terminal and poke around:
ls /
ls /etc
ls /usr/bin
ls -l /bin
cat /proc/cpuinfo | head -20
Read what’s there. The Linux file hierarchy isn’t a mystery once you’ve seen it. It’s a map, and now you’ve got the legend.
