Windows PowerShell (practice mode: nothing here touches your real computer)
Lesson 23: Practice: the clean-up mission
Level 3, Terminal Power and Safety. Tidy a messy Downloads folder the safe way. It follows lesson 22, Running programs. Next comes lesson 24, Level 3 test: Safe Hands.
What the lesson explains
The clean-up mission. Downloads is a mess. Tidy it the safe way.
What you do first
What is in here?. In the practice terminal, type dir at the prompt PS C:\Users\you\Downloads> and the computer answers: Directory: C:\Users\you\Downloads / Mode Name / ---- ---- / d---- games / d---- treasure / -a--- funny-cat.png / -a--- homework-final-2.txt / -a--- homework-final.txt / -a--- setup.tmp.
The files on the practice computer
This lesson works in one folder. At the start, Downloads holds games\, treasure\.
Along the way you find a note, homework-final.txt, in Downloads, find a note, homework-final-2.txt, in Downloads, save setup.tmp in Downloads, save funny-cat.png in Downloads, type rm homework-final-2.txt, type ren homework-final.txt homework.txt, type move homework.txt ~\Documents, type move funny-cat.png ~\Pictures, type rm setup.tmp -WhatIf and type rm setup.tmp. Lesson 24 opens with the files just as you leave them.
What you practise
Look first, "What is in here?": In the practice terminal, type dir at the prompt PS C:\Users\you\Downloads> and the computer answers: Directory: C:\Users\you\Downloads / Mode Name / ---- ---- / d---- games / d---- treasure / -a--- funny-cat.png / -a--- homework-final-2.txt / -a--- homework-final.txt / -a--- setup.tmp. Then: In the practice terminal, type cat homework-final-2.txt at the prompt PS C:\Users\you\Downloads> and the computer answers: My homework: 2 + 2 = 4. Then: homework-final-2.txt says exactly what homework-final.txt says. What is it? The answer: "A twin you can delete".
Tidy up, "Delete, rename, move": In the practice terminal, type rm homework-final-2.txt at the prompt PS C:\Users\you\Downloads> and the computer answers: (deleted homework-final-2.txt — there's no recycle bin in the terminal!). Then: In the practice terminal, type ren homework-final.txt homework.txt at the prompt PS C:\Users\you\Downloads>; the prompt then reads PS C:\Users\you\Downloads>. It makes homework.txt. Then: In the practice terminal, type move homework.txt ~\Documents at the prompt PS C:\Users\you\Downloads>; the prompt then reads PS C:\Users\you\Downloads>. It makes homework.txt. Then: In the practice terminal, type move funny-cat.png ~\Pictures at the prompt PS C:\Users\you\Downloads>; the prompt then reads PS C:\Users\you\Downloads>. It makes funny-cat.png.
Challenge, "The last file": Check with -WhatIf, then delete setup.tmp. Starting at PS C:\Users\you\Downloads>, one way takes 2 commands: rm setup.tmp -WhatIf; rm setup.tmp (par: 3).
What PlayBuddy and PlayType say
PlayType: "Mission time! The downloads folder is a mess. Let’s tidy it the safe way."
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 8 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.