Efficient terminal navigation is the foundation of everything else you do on the command line. Before you can edit files, manage processes, or configure systems, you need to know where you are, what’s around you, and how to get where you’re going. These four commands — pwd, cd, ls, and find — are the ones you’ll use hundreds of times a day.
Knowing where you are with pwd
The pwd command (print working directory) tells you your current location in the filesystem. It’s the simplest command you’ll use and the first one to reach for when you’re disoriented after a chain of directory changes.
pwd
# /home/user/projects/security-lab
When you open a new terminal, you start in your home directory (~). The pwd command gives you the absolute path, which is essential when writing scripts that need to reference the current location.
Moving around with cd
cd (change directory) is how you move through the filesystem. The basics are straightforward, but a few patterns save significant time:
cd /path/to/dir # Go to absolute path
cd relative/path # Go to relative path
cd ~ # Go to home directory
cd - # Go to PREVIOUS directory (toggle)
cd .. # Go up one level
cd ../.. # Go up two levels
The
cd -shortcut is one of the most underused navigation commands. It toggles between your current and previous directory — invaluable when you’re working across two locations.
Seeing what’s around you with ls
ls lists directory contents, but its flags transform it from a simple listing tool into a detailed information display:
ls # Basic listing
ls -l # Long format (permissions, size, date)
ls -la # Include hidden files (dotfiles)
ls -lh # Human-readable file sizes
ls -lt # Sort by modification time (newest first)
ls -lS # Sort by file size (largest first)
Modern alternatives like eza (formerly exa) provide color-coded output, git status integration, and tree views out of the box. Consider aliasing ls to eza once you try it.
Finding anything with find
When you know a file exists somewhere but don’t know exactly where, find is your tool. It recursively searches directories based on name, type, size, modification time, and more:
find . -name "*.py" # Find by name pattern
find . -type f -mtime -7 # Files modified in last 7 days
find . -type d -name "test*" # Directories matching pattern
find . -size +100M # Files larger than 100MB
find . -name "*.log" -delete # Find and delete
Combining these four commands fluently is what separates comfortable terminal users from those who feel lost without a file manager GUI. Practice them until they’re muscle memory.
Ready to practice? Explore the project repository for the full navigation reference guide and interactive exercises.