Portmint Lighthouse

Moving Between Folders

Here is the plain idea: you can walk from one folder into another by typing a command — stepping inside, then back out, the way you move from room to room in a house. You don't carry your files with you; you move, and your "you are here" dot moves with you. This is how you get from where you start to wherever the work actually is.

So far we've stayed put: we found our spot with pwd and looked around with ls. Now we move.

Walking through doorways

Picture your home folder as the front hall of a house. Off the hall are doors: one to Documents, one to Downloads, one to Pictures. To get into a room, you walk through its door. To leave, you step back out into the hall.

Moving in the terminal is exactly that — walking through doorways. You name the room you want, and the computer moves your dot there. After you walk in, an ls shows you that room's contents instead of the hall's. You're somewhere new. 🔦

The move command

The command is cd, short for "change directory" — change which folder you're standing in. You type cd, a space, then the name of the folder you want to enter:

cd Documents

Press Enter, and quietly, with no fanfare, you're now inside Documents. The terminal usually says nothing — silence here means "done, it worked." Type pwd to confirm your dot has moved, and ls to see what's in this new room.

A small but important detail: spelling and capital letters often matter. cd documents and cd Documents may be treated as different on some computers. If cd complains it can't find the folder, check your ls for the exact name and match it letter for letter.

Stepping back out

Walking in is half the skill. Walking out is the other half, and it has its own bit of shorthand.

cd ..

Those two dots mean "the folder one level up" — the room that contains the one you're in, like stepping back into the hall. So if you're in Documents and type cd .., you land back in your home folder. Two dots, every time, means "back up one."

You can even chain it: cd ../.. steps up two levels at once. But one step at a time, checking with pwd, is the calm way to learn.

The "take me home" shortcut

Sooner or later you'll wander deep into nested folders and feel a little lost. Don't worry — there's a one-word trip home.

cd ~

Remember the squiggle ~ means "my home folder." So cd ~ always teleports you straight back to home, no matter how far you've roamed. Even shorter: typing just cd with nothing after it does the same thing. Think of it as the "you are here is now the front door again" button. Whenever you feel turned around, go home and start fresh.

A gentle word on names with spaces

If a folder's name has a space in it, like My Notes, the terminal gets confused — it thinks My and Notes are two separate things. Wrap the name in quotes to keep it together:

cd "My Notes"

The quotes say "treat all of this as one name." It's a tiny habit that saves a common headache.

Your turn

In your terminal, type cd followed by the name of a real folder you saw with ls — try cd Documents. Confirm with pwd, then look around with ls.

Now type cd .. to step back out, and pwd again to watch your dot return. Finally, cd ~ to go home. You just moved through your computer using only words — and you always knew exactly where you were.

Next up: making things — creating brand-new folders and files from scratch. 🐙

Stuck or curious?

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