The three commands you'll run a thousand times a day
pwd tells you where you are. cd moves you somewhere. ls shows what's there. Master these three and you can find any file on the system without a GUI.
pwd — print working directory
The shell remembers your current working directory. Every relative path you type is resolved against it. pwd prints it. pwd -P resolves any symlinks in the path so you see the physical location.
cd — change directory
cd path moves you. Special arguments earn their keep:
cdwith no argument — home directorycd ~— same thing, explicitcd -— toggle between the two most recent directories (huge time-saver)cd ~user— that user's home (if you have permission)
Zsh adds setopt AUTO_CD: typing a bare directory name (no cd) jumps into it. Pair with the zoxide tool from the modern-tools track and you almost never type cd again.
ls — list directory contents
Plain ls shows visible files only. The flags you'll wear out:
-a— include hidden (dotfiles)-l— long format with permissions, owner, size, mtime-h— human-readable sizes (with -l)-t— sort by modification time, newest first-r— reverse sort-S— sort by size-R— recurse into subdirectories
The classic combo: ls -lah = long, all, human-readable. Memorize it; you'll type it more than your name.
Fix the reference point before moving
A relative path depends on the working directory, so the same command can resolve to a different target. Before copying or deleting, print pwd and the resolved target. In scripts, distinguish the script's location from its working directory.
What ls does not show still matters
Unreadable directories, unmounted volumes, and hidden names excluded by a glob can disappear from a listing. Before turning “not visible” into “absent,” inspect diagnostics and permissions.