The path
🐧 First StepsLesson 4 of 30 6 min 30 XP

🧭Where am I? pwd, ls and cd

The three commands that let you walk around your computer without getting lost.

You are a tiny explorer inside a big tree of folders. You always stand in exactly one folder. These three commands tell you where you are, what is around you, and how to walk.

Commands in this lesson

pwdPrint working directory: the folder you are standing in
/home/penguin
lsList what is here
notes/   penguins/   welcome.txt
cd notesWalk into the notes folder
cd ..Walk back up one folder
cdJump straight back home

💡 Think of it like this

pwd is looking at the map. ls is looking around. cd is taking a step through a door.

⚠️ Careful

cd needs a folder to walk into. If you type cd banana and there is no banana folder, the computer will say No such file or directory. That is not a crash, just a polite no.

🔬 The grown-up version

cd .. goes to the parent directory, and cd - jumps back to the previous directory. Tab completion finishes folder names for you, which is faster and avoids typos.

Now you try

This terminal is pretend, so you cannot break anything. Tap a chip or type a command yourself.

tux — bashpractice

Try the commands from this lesson. Type one and press Enter, or tap a chip below.

penguin@tux:~$
try

Quick check

Which command shows the folder you are standing in?

What does cd .. do?

You type ls and see penguins/ with a slash at the end. What is it?

Finished this one?

Mark it done to collect 30 XP and keep your streak growing.