First thing to understand — in Linux, everything is a file. Devices, processes, sockets, hardware — all represented as files somewhere.

And it all starts from one place: / (called “root”).

No C:\ or D:\ like Windows. One tree, everything hangs off /.


Open your terminal and run:

ls /

You’ll see the top-level directories. Here’s what the important ones mean:

DirectoryDescriptionCommon contents & what they are
/binCommands everyone uses dailyls (list files), cp (copy), mv (move), cat (read file), bash (the shell itself), chmod (change permissions)
/bootEverything needed to start the OS before the kernel fully loadsgrub/ (bootloader config), vmlinuz (the compressed kernel file), initrd.img (temporary filesystem used during boot)
/devHardware represented as files — remember, everything is a file in Linuxsda (your main hard disk), tty (terminal devices), null (a black hole — anything written here disappears), zero (infinite stream of zeros), random (generates random bytes)
/etcThe system’s control room — all configuration lives herepasswd (user accounts list), hosts (local DNS — maps names to IPs), fstab (what drives to mount on boot), ssh/ (SSH server config), nginx/ (nginx web server config), cron.d/ (scheduled tasks)
/homeEach user on the system gets their own personal folder here/home/kingsley/ contains your Desktop/, Downloads/, .bashrc (your shell config), .ssh/ (your SSH keys)
/libShared code that programs in /bin and /sbin depend on to run*.so files — think of these like .dll files on Windows, shared libraries multiple programs use simultaneously
/mediaWhen you plug in a USB or external drive, Linux auto-mounts it here/media/kingsley/USB_DRIVE/ — your files on that drive appear here
/mntA manual mount point — you decide what goes hereIf you manually mount a second hard drive or network share, you’d put it here
/optThird-party software that doesn’t follow standard Linux structure installs here/opt/google/ (Google Chrome), /opt/lampp/ (XAMPP), basically any software that bundles everything into one folder
/procA fake filesystem — nothing here is on disk, it’s live data the kernel generates on the flycpuinfo (your CPU details), meminfo (RAM usage), uptime (how long system has been running), 1/ (folder with everything about PID 1 — open files, memory maps, etc)
/rootThe home directory for the root (admin) user — separate from /home for securitySame structure as a normal home folder but only accessible by root
/runFresh runtime data generated after every boot — wiped and recreated each startupsystemd/ (systemd runtime state), lock/ (lock files so two processes don’t do the same thing), user/ (per-user runtime data)
/sbinSystem administration commands — mostly for the root userfdisk (partition disks), fsck (check/repair filesystem), iptables (firewall rules), reboot (restart system)
/srvData that services on this machine serve to the outside world/srv/http/ (files your web server serves), /srv/ftp/ (files your FTP server serves)
/sysLike /proc but focused specifically on hardware and kernel subsystemsblock/ (block devices like disks), bus/ (hardware buses like USB, PCI), class/ (device categories), devices/ (every device the kernel knows about)
/tmpScratch space — anything here gets wiped on rebootSession files, build artifacts, anything a program needs temporarily
/usrThe bulk of installed software and their supporting filesbin/ (non-essential user commands), lib/ (their libraries), local/ (stuff you compile/install manually), share/ (documentation, icons, shared data)
/varData that constantly changes as the system runslog/ (system and app logs), cache/ (cached app data), mail/ (mail spool), www/ (web server files on some distros), lib/ (persistent app state data)
/swapfileOverflow space — when RAM is full, the kernel moves less-used memory here temporarilyA single file, not a directory
/snapUbuntu’s snap package system stores self-contained app bundles here/snap/firefox/ (Firefox as a snap), /snap/core/ (snap runtime itself)
/lost+foundIf your filesystem crashes and the OS recovers broken file fragments, they end up hereFilesystem debris — you’d only look here after a crash

Interesting commands to run

ls /etc | head -20
ls /var
ls /proc | head -20
 
# view the content of cpu info
cat /proc/cpuinfo | head -30
cat /proc/meminfo | head -10
# You're literally reading live kernel data as a file.
↑ Back to Linux