Linux file system hierarchy explained
FHS standard, root directory, /etc /var /usr /home /tmp /bin, absolute vs relative paths, mount points
Everything Is a File
Linux uses the Filesystem Hierarchy Standard (FHS). Every file, device, and socket lives under a single root: /. There is no C:\ drive concept. Understanding where things live saves hours of debugging.
Critical Directories You Will Use Daily
/etc — system-wide configuration files. Nginx config, SSH config, environment variables for services — all here. /var/log — application and system logs. First place to look when something breaks. /home/username — your personal directory. /tmp — temporary files, wiped on reboot. /usr/bin — user-installed executable binaries. /bin — essential system binaries needed before /usr mounts.
Absolute vs Relative Paths
An absolute path starts at root: /home/alice/projects. A relative path starts from your current location: ../projects means one level up then into projects. The tilde ~ always expands to your home directory.
# Print your current directory
pwd
# Absolute path — always works regardless of where you are
ls /etc/nginx
# Relative path — depends on current directory
cd ~/projects
ls ../configWhen writing scripts, prefer absolute paths. Relative paths break when the script is called from a different working directory.
