Windows PowerShell (practice mode: nothing here touches your real computer)
Lesson 16: Copy, move and rename
Level 3, Terminal Power and Safety. Twins with copy, trips with move, new names with ren. The new word: Copy-Item. It follows lesson 15, Level 2 test: Command Captain. Next comes lesson 17, Delete carefully (rm).
What the lesson explains
Copy, move, rename. Twins, trips and new labels.
What you do first
Make a twin. In the practice terminal, type copy notes.txt notes-backup.txt at the prompt PS C:\Users\you\Documents\my-project>; the prompt then reads PS C:\Users\you\Documents\my-project>. It makes notes.txt and notes-backup.txt.
The files on the practice computer
This lesson works in one folder. At the start, Documents\my-project holds club\, games\, images\, my-games\, fish.txt, hello.py, list.txt, notes.txt.
Along the way you type copy notes.txt notes-backup.txt, type mkdir backups, type move notes-backup.txt backups, type ren list.txt shopping.txt, type move fish.txt games and type copy club\members.txt backups\members-old.txt. Lesson 17 opens with the files just as you leave them.
What you practise
Try it, "Make a twin": In the practice terminal, type copy notes.txt notes-backup.txt at the prompt PS C:\Users\you\Documents\my-project>; the prompt then reads PS C:\Users\you\Documents\my-project>. It makes notes.txt and notes-backup.txt.
Try it, "Take it on a trip": In the practice terminal, type mkdir backups at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: Directory: C:\Users\you\Documents\my-project / d---- backups. It makes backups. Then: In the practice terminal, type move notes-backup.txt backups at the prompt PS C:\Users\you\Documents\my-project>; the prompt then reads PS C:\Users\you\Documents\my-project>. It makes notes-backup.txt.
Try it, "A new label": In the practice terminal, type ren list.txt shopping.txt at the prompt PS C:\Users\you\Documents\my-project>; the prompt then reads PS C:\Users\you\Documents\my-project>. It makes shopping.txt. Then: In the practice terminal, type cat shopping.txt at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: Buy milk / Bread.
In your head, "Where does it go?": You type move fish.txt games. Where is fish.txt now? The answer: "In games".
Challenge, "Back up the club": Back up members.txt as members-old.txt. Starting at PS C:\Users\you\Documents\my-project>, one way takes 1 command: copy club\members.txt backups\members-old.txt (par: 2).
What PlayBuddy and PlayType say
PlayType: "Welcome to Level 3! Copy makes a twin. Move takes a file on a trip."
PlayBuddy: "Copy needs two names: the file you have, then the new one."
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 7 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.