Windows PowerShell (practice mode: nothing here touches your real computer)
Lesson 10: Walk around (cd)
Level 2, Talk to Your Computer: PowerShell. Walk in, walk back up, jump home with ~, and use whole paths. The new word: home folder (~). It follows lesson 9, Look around (dir and ls). Next comes lesson 11, Build things (mkdir and ni).
What the lesson explains
Walk around. cd walks in, cd .. walks up, cd ~ jumps home.
The squiggle means home. Wherever you are, cd ~ takes you to C:\Users\you. On the card: cd ~
Many folders at once. cd takes a whole path, like the ones from Level 1. On the card: cd Documents\my-project
What you do first
In and out. In the practice terminal, type cd Documents at the prompt PS C:\Users\you>; the prompt then reads PS C:\Users\you\Documents>.
The files on the practice computer
This lesson works in 6 folders. At the start, your home folder, C:\Users\you holds Desktop\, Documents\, Downloads\, Pictures\; Documents holds music\, my-project\, stories\; Documents\stories holds story.txt; Documents\my-project\images holds cat.png; Documents\music holds song.mp3; Pictures holds beach.jpg.
You change nothing here, so lesson 11 finds the same files.
What you practise
Try it, "In and out": In the practice terminal, type cd Documents at the prompt PS C:\Users\you>; the prompt then reads PS C:\Users\you\Documents>. Then: In the practice terminal, type cd stories at the prompt PS C:\Users\you\Documents>; the prompt then reads PS C:\Users\you\Documents\stories>. Then: In the practice terminal, type dir at the prompt PS C:\Users\you\Documents\stories> and the computer answers: Directory: C:\Users\you\Documents\stories / Mode Name / ---- ---- / -a--- story.txt. Then: In the practice terminal, type cd .. at the prompt PS C:\Users\you\Documents\stories>; the prompt then reads PS C:\Users\you\Documents>.
Try it, "Jump home": In the practice terminal, type cd ~ at the prompt PS C:\Users\you\Documents\music>; the prompt then reads PS C:\Users\you>.
Challenge, "Find the cat again": Starting at C:\Users\you\Pictures, use dir and cd to reach C:\Users\you\Documents\my-project\images, then type dir there (par: 3 commands).
What PlayBuddy and PlayType say
PlayType: "Looking is great. Now let’s walk around!"
PlayBuddy: "The squiggle means home. One jump, and you are back."
PlayType: "You can walk through many folders at once. Just type the path."
Help in every lesson
Everything happens on a pretend computer in your browser, so nothing touches your real files. PlayBuddy and PlayType stand beside the board, cheer you on and say when it is your turn.
A green ring shows where to click the first time. After that you do it on your own, and if you slip twice the ring comes back.
Stars
The lesson has 6 things to do. Up to one slip in ten gives three stars, up to one in four gives two, and finishing always gives at least one. Stars and progress are saved in this browser only; there is no account.
About DayOneCode
DayOneCode is an independent learning site, not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic.