AI Learning Hub › Learn AI › Self-Paced Courses › Terminal on Mac: Reading Commands Before You Run Them › Where You Are

Module 2 · Beginner

Where You Are

Every command runs somewhere. The current directory is what a relative path is measured from, and answering “relative to what?” is the foundation of everything after this.

By the end

  • Say which folder your terminal is currently working in
  • Read a path and answer “relative to what?”
  • Use ~, . and .. correctly
  • See files that Finder hides
  • Open the current folder in Finder

Nearly every confusing moment in a terminal traces back to one question nobody thinks to ask: which folder am I in? A command that works perfectly in one place does nothing in another, and the difference is invisible unless you look.

Set up the practice folder

Download the practice folder from the course landing page if you have not already, and unzip it into your home folder — the one with your name on it, which Finder shows under Go › Home. You should end up with a folder called terminal-practice.

Then point your terminal at it.

Try it

cd ~/terminal-practice

Everything in this course happens inside that folder. That is deliberate: a command that reaches further than you meant costs nothing there, and the recovery plan is to unzip the download again.

Where am I?

Three commands answer the question, and you met them in the VS Code course if you took it.

Three navigation commands and what each one answers
CommandWhat it answers
pwdWhich folder am I in? It prints the full path.
lsWhat is in it?
cdGo somewhere else.

pwd stands for print working directory, and “working directory” is the formal name for the folder your terminal is currently sitting in. This course mostly says current folder, which means the same thing.

Two kinds of path

A path is a route to a file or folder, and there are two ways to write one.

An absolute path
Starts with a slash and gives the whole route from the top of the disk: /Users/your-name/terminal-practice/notes. It means the same thing no matter where you are standing.
A relative path
Starts anywhere else and is measured from your current folder: notes, or notes/case-list.txt. It means something different depending on where you are.

That second sentence is the module. When you read a path in a command — especially one somebody else wrote — the first question is whether it begins with a slash. If it does not, it is relative, and you need to know the current folder before you can say what it points at.

Three shorthands

Three characters appear in paths constantly and none of them is guessable.

A tilde, written ~
Your home folder. ~/terminal-practice means the practice folder inside your home folder, whatever your account is called. It works from anywhere.
A single dot, written .
Right here — the folder you are currently in. ./notes and notes mean the same thing; the dot is just explicit about it.
Two dots, written ..
One level up. cd .. moves to the folder that contains the one you are in. This is how you get back out.

Files Finder does not show you

A folder can contain more than Finder displays. Names that begin with a dot are hidden by default, and they are often the files that configure things.

A Terminal window. The command ls lists five items: README.md, archive, cases, notes and output. The command ls -a then lists eight: a single dot, two dots, .gitignore, and the same five items as before.
ls and then ls -a in the same folder. The second shows a .gitignore that was there all along, plus the single dot and double dot entries that mean here and one level up. macOS 26.6, zsh 5.9, October 2026.

Those hidden names matter later. Module 9 comes back to them, because a folder you hand to a tool may contain configuration you have never looked at.

Finder and Terminal are looking at the same files

This is worth proving to yourself rather than taking on trust, because it dissolves a common misconception — that the command line is somehow underneath, or more real, or operating on something different. It is not. There is one set of files, and two ways of looking at them.

Run this from the practice folder.

Try it

open .

A Finder window opens on the folder you are standing in. The open command is Mac-specific, and its manual describes it as opening something “just as if you had double-clicked the file’s icon.” The single dot is the path — here.

Exercise: predict, then check

Do the prediction part on paper first. Guessing and then running teaches less than committing and then finding out.

Starting from ~/terminal-practice, write down where you expect to be after each step, then run the steps and compare.

  1. pwd
  2. cd notes then pwd
  3. cd .. then pwd
  4. cd cases then ls
  5. cd ~ then pwd
  6. cd ~/terminal-practice then ls -a

Then one more, with Finder: run open . and compare the Finder window’s contents with what ls -a just printed. Note which entries appear in one and not the other.

What you should have found

Step 5 takes you out of the practice folder entirely, to your home folder. Step 6 brings you back. If step 4 left you in cases and step 5 felt like a bigger jump than the others, that is the difference between a relative path and ~.

Finder shows five items. ls -a shows eight: the same five, plus .gitignore, plus . and ... The dot-file is genuinely there; Finder is choosing not to display it.

If any cd produced no such file or directory, you were not where you thought you were. Run pwd and start again — which is the habit this whole module is trying to build.