The concept
Every Linux system organizes files into a single tree starting at the root directory, written as a forward slash. There are no drive letters. Disks, USB sticks and network shares are attached, or mounted, at directories inside that tree. Knowing where things live is the first administration skill, because almost every task starts with finding a configuration file, a log or a binary.
The directories that matter
- /etc: system-wide configuration. Nearly every service keeps its settings here.
- /var: variable data. Logs live in /var/log, mail spools and databases often under /var/lib, web content commonly under /var/www.
- /home: user home directories. The root user has /root instead.
- /usr: installed software. Binaries in /usr/bin and /usr/sbin, libraries in /usr/lib, documentation in /usr/share.
- /opt: optional third-party software installed outside the package manager.
- /tmp: temporary files, usually cleared on reboot.
- /proc and /sys: virtual filesystems exposing kernel and hardware information as files.
- /dev: device files such as /dev/sda for the first disk.
- /boot: the kernel and bootloader files.
Navigation commands
pwd
ls -la /etc
cd /var/log
cd ..
cd -
cd ~
find /etc -name '*.conf' -mtime -7
which nginx
du -sh /var/log/*
df -h
pwd prints where you are. ls -la lists everything including hidden dotfiles with permissions and sizes. cd – jumps back to the previous directory, and cd alone returns home. find searches by name, type, size or modification time; the example lists config files changed in the last week, which is a fast way to see what someone touched recently. du shows disk usage per item and df shows free space per mounted filesystem.
A worked example
A colleague says the web server is misbehaving and you have never seen this machine. Start by locating the service configuration and its logs.
which nginx
ls /etc/nginx/
ls -lt /var/log/nginx/ | head
df -h /var
In under a minute you know the binary exists, where its config is, which log was written most recently and whether the log partition is full, which is one of the most common causes of a service that silently stops working.
Common mistakes
- Running find from / without limiting the path, which crawls the whole disk and prints permission errors for minutes.
- Editing files in /usr that the package manager owns. Your changes are overwritten on the next update; configuration belongs in /etc.
- Filling /tmp or /var and not noticing until services fail. Check df regularly.
Action Step
On a Linux machine you can access, run ls -la on each of the directories listed above and write one sentence about what you found in each. Then run df -h and note which filesystem has the least free space.