INTRODUCTION
Commands have parts
What to do, what to do it to, and how.
press Enter ↵
C:\Users\you\Documents
diarymusicmy-projectstoriesvault
⬆ Documents is inside you

Windows PowerShell (practice mode: nothing here touches your real computer)

 

Lesson 18: Commands have parts

Level 3, Terminal Power and Safety. Command, what, how: spot the parts, and ask "what if?" first. The new word: parameter. It follows lesson 17, Delete carefully (rm). Next comes lesson 19, Dialects: PowerShell, CMD, Mac.

What the lesson explains

Commands have parts. What to do, what to do it to, and how.

Command, what, how. A word with a dash in front is a parameter. rm: the command; notes.txt: what; -WhatIf: how.

What you do first

Ask "what if?". In the practice terminal, type rm shopping.txt -WhatIf at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: What if: Performing the operation "Remove File" on target "C:\Users\you\Documents\my-project\shopping.txt".. It makes shopping.txt.

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 rm notes.txt -WhatIf and type rm shopping.txt -WhatIf. Lesson 19 opens with the files just as you leave them.

What you practise

Try it, "Ask "what if?"": In the practice terminal, type rm shopping.txt -WhatIf at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: What if: Performing the operation "Remove File" on target "C:\Users\you\Documents\my-project\shopping.txt".. It makes shopping.txt. Then: In the practice terminal, type dir -Name at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: backups / club / games / images / my-games / hello.py / notes.txt / shopping.txt.

Try it, "Ask for the parts": In the practice terminal, type help copy at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: Copy-Item (copy, cp) / copy <what> <where> [-Recurse] [-WhatIf] / Makes a twin. The second name is the new file, or a folder to put the twin in..

Spot the parts, "Which part is which?": In copy notes.txt backups , which part is the command? The answer: "copy". Then: In dir images -Name , which part changes how it works? The answer: "-Name". Then: What does a dash at the start of a word mean? The answer: "A parameter: it says how".

What PlayBuddy and PlayType say

PlayType: "Every command has parts. First what to do, then what to do it to."

PlayBuddy: "A dash starts a parameter. It changes how the command works."

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.