Windows PowerShell (practice mode: nothing here touches your real computer)
Lesson 19: Dialects: PowerShell, CMD, Mac
Level 3, Terminal Power and Safety. ls or dir, cp or copy: many names, one command. The new word: alias. It follows lesson 18, Commands have parts. Next comes lesson 20, Red text is a clue.
What the lesson explains
Computer dialects. PowerShell, CMD, Mac and Linux.
Two names, one command. ls and dir both run Get-ChildItem. On the card: Get-Alias ls
What you do first
The Mac and Linux words. In the practice terminal, type Get-Alias cp at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: CommandType Name / ----------- ---- / Alias cp -> Copy-Item.
The files on the practice computer
This lesson works in one folder. At the start, Documents\my-project holds backups\, club\, games\, images\, my-games\, hello.py, notes.txt, shopping.txt.
Along the way you type cp notes.txt notes-twin.txt and type mv notes-twin.txt backups. Lesson 20 opens with the files just as you leave them.
What you practise
Try it, "The Mac and Linux words": In the practice terminal, type Get-Alias cp at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: CommandType Name / ----------- ---- / Alias cp -> Copy-Item. Then: In the practice terminal, type cp notes.txt notes-twin.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-twin.txt. Then: In the practice terminal, type mv notes-twin.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-twin.txt.
Dialect match, "Which word works where?": On a Mac, which command lists a folder? The answer: "ls". Then: In the old Windows CMD, which clears the screen? The answer: "cls". Then: Which of these work in PowerShell? The answer: "Both ls and dir". Then: mv on a Mac does the same job as which PowerShell command? The answer: "move".
What PlayBuddy and PlayType say
PlayBuddy: "Computers speak dialects, like people. PowerShell understands lots of them!"
PlayType: "Two names, one command. A nickname like that is called an alias."
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.