0 / 15 lessons — 0%
Lesson 01 / 15 🐧
Filesystem hierarchy & permissions
Every Linux system, regardless of distro, organizes files under one root directory according to a shared convention — the Filesystem Hierarchy Standard (FHS). Learn it once and it transfers everywhere.
Everything hangs off one root. No drive letters — just one tree, mounted disks included.
| Path | What lives there |
|---|---|
/etc | System-wide configuration files, almost always plain text |
/home | Personal directories, one per user |
/var | Data that changes constantly — logs, caches, mail spools |
/usr | Installed software and its supporting files |
/bin, /sbin | Core executables (often symlinked into /usr on modern distros) |
/tmp | Temporary files, often wiped on reboot |
/proc, /sys | Virtual filesystems exposing the running kernel and hardware, not real files on disk |
Permissions
Every file has an owner, a group, and permission bits for three audiences: the owner, the group, and everyone else. ls -l shows them as ten characters.
-rwxr-xr-- 1 alice devs 8420 Aug 12 09:14 deploy.sh │└┬┘└┬┘└┬┘ │ │ │ └── others: r-- (read only) │ │ └───── group: r-x (read + execute) │ └──────── owner: rwx (read + write + execute) └────────── file type (- = regular file, d = directory, l = symlink)
chmod 750 deploy.sh # owner rwx, group r-x, others nothing chmod u+x deploy.sh # add execute for the owner only chown alice:devs deploy.sh # change owner and group
The numbers in chmod 750 are read/write/execute added up per audience: read=4, write=2, execute=1. 7 = 4+2+1 (rwx), 5 = 4+1 (r-x), 0 = nothing.
Try it yourselfRun
ls -l /etc/shadow and ls -l /etc/hosts and compare their permissions. One is world-readable, one very much isn't — think about why before you look up the answer.