Portmint Lighthouse

Where Am I? Finding Your Place

Here is the plain idea: when you're in the terminal, you are always standing inside one folder. Not floating in space — in a specific spot, the same way you're always in one room of a house. Knowing which room you're in is the very first skill, because every other command happens relative to where you're standing.

When you opened the terminal, it placed you somewhere by default — usually your "home" folder, the one with your documents and downloads. You just couldn't see it. Let's make it visible.

The "you are here" dot

Think of a map at a shopping mall. The whole thing is just lines and shapes until you find the bright dot that says you are here. Suddenly everything makes sense — the food court is that way, the exit is this way, all measured from your dot.

The terminal has the same dot. There's one short command that points at it and says "this is the folder you're currently standing in." Without it, the commands you type later have no anchor. With it, you always know your starting point. 🔦

Asking "where am I?"

The command is pwd. It stands for "print working directory" — and "directory" is just an old word for folder, so really it means "show me the folder I'm working in right now."

Type pwd, press Enter, and the computer answers with a line like this:

/Users/cole/Documents

Read that from left to right and it's a trail of folders, each tucked inside the one before it, separated by slashes. This says: there's a folder called Users, and inside it one called cole, and inside that one called Documents — and Documents is exactly where you're standing right now.

That trail has a name: a path. A path is just the full set of directions from the top of the computer down to where you are, like writing out a street address from country to city to street to house number.

The very top, and your home

Two landmarks are worth knowing.

That first slash, all the way on the left, is the root — the very top of everything, the ground floor the whole computer is built on. Every path starts its journey from there.

And the folder you start in is your home folder — your personal area, the one with your name on it. The terminal has a friendly shorthand for it: the squiggle ~ (called a tilde). Wherever you see ~, read it as "my home folder." It saves typing out the long path every time.

Why this matters before anything else

It's tempting to skip ahead to the exciting commands. But almost every confusing moment a beginner has in the terminal comes down to one thing: they forgot where they were standing.

You'll go to make a file and it appears somewhere unexpected. You'll try to open something and the computer says it can't find it. Nine times out of ten, the answer is "you weren't in the folder you thought you were in." So whenever the terminal surprises you, your first move is calm and simple: type pwd and check your dot on the map.

Your turn

Open your terminal and type pwd, then press Enter.

Read the path it gives you out loud, slash by slash, like an address: "inside this, inside this, inside this — here I am." Don't worry about the exact words; just feel the shape of it. That trail is your current location, and now you can always find it.

Next up: looking around the room — seeing what's actually in the folder you're standing in. 🐙

Stuck or curious?

Ask Pip about this lesson — tap the porthole bottom-right.