Navigating Around
Now that you can see where you are, let’s learn to move around.
ls — List Directory Contents
What it does: Shows you what’s in the current directory.
Try it now: Type ls
You’ll see the files and folders in your home directory. Folders like Documents, Downloads, and projects should appear.
cd — Change Directory
What it does: Moves you to a different directory.
Try it now: Type cd projects then ls
You’ve moved into the projects folder! Notice the prompt changed — it now shows ~/projects instead of ~.
Going Deeper
Type cd my-app and then ls. You’re now inside a real-looking project with src/, public/, tests/, and more.
Going Back Up
Type cd .. to go up one level.
The .. means “parent directory” — the folder that contains the one you’re in.
Try it: Type cd .. a few times and run pwd after each one to see where you end up.
Key Navigation Shortcuts
| Command | What it does |
|---|---|
cd ~ |
Go to your home directory (/home/user) |
cd .. |
Go up one directory |
cd - |
Go back to the previous directory |
cd / |
Go to the root (top) of the filesystem |
Try it now: Type cd ~/projects/my-app — this jumps straight to the project directory from anywhere.
Absolute vs. Relative Paths
There are two ways to describe a location:
Absolute paths start with / — they describe the full path from the root:
/home/user/projects/my-app/src/index.js
Relative paths start from where you are now:
src/index.js (if you're in my-app/)
../my-app/src/index.js (if you're in projects/)
The ~ shortcut always means /home/user:
~/projects is the same as /home/user/projects
You'll often see your AI tool run commands like
cd ~/projects/my-app && ls src/. Now you know: it's moving to the project folder and listing the source code. The && means "do the next command only if the first one worked."
Practice
Try navigating to these locations and back:
cd ~/Documents— check what’s there withlscd ~/projects/my-app/src— see the source filescd ~— return homecd -— jump back to where you just were