⭐ 0🔥 0🏆 0 pts

For grown-ups and teens who want their first commands on one page

Your first commands on one page: a PowerShell cheat sheet

This PowerShell cheat sheet puts the terminal commands from the DayOneCode course on one printable page, with what each does, an example, the lesson that teaches it and, for most, a Try button.

Quick answer

  • Find your way: pwd says where you are, dir looks around, cd walks in and cd .. walks back.
  • Change things: mkdir, ni, copy, move, ren and rm cover most everyday jobs.
  • Rehearse with -WhatIf first: a file deleted with rm in PowerShell skips the Recycle Bin.
  • Short names such as ls, cat and rm are aliases that PowerShell sets up on Windows only.

The tables below hold every terminal command in the course’s Command Book, grouped by the job it does. Press Try to drop a command onto the practice terminal underneath: a pretend Windows PowerShell with a pretend disk, so your real files are never touched.

Press Try to put a command on the practice terminal below, then press Enter.
Moving around
CommandWhat it doesExampleLearn itTry
pwdalso Get-LocationSays which folder the terminal is standing in: the working directory.pwdLesson 8
diralso ls, Get-ChildItemLists what is in a folder. A d at the start of a line means a folder.dirLesson 5
lsalso dirThe same as dir. Add a folder name to peek inside without moving.ls imagesLesson 9
cdalso Set-LocationWalks into a folder. cd .. walks up one folder, cd ~ jumps home.cd DocumentsLesson 5
cd ~Jumps straight home, to C:\Users\you, from anywhere.cd ~Lesson 10
Making and reading files
CommandWhat it doesExampleLearn itTry
mkdiralso mdMakes a new folder. Use a dash, not a space, in the name.mkdir gamesLesson 11
nialso New-ItemMakes a new, empty file.ni ideas.txtLesson 11
echoalso Write-OutputSays words back. With > it writes them into a file; >> adds a line at the end.echo "Feed the fish" > fish.txtLesson 12
catalso type, Get-ContentShows what is inside a file.cat fish.txtLesson 12
clsalso clearClears the screen. Your files stay safe.clsLesson 13
Copy, move, rename and delete
CommandWhat it doesExampleLearn itTry
copyalso cp, Copy-ItemMakes a twin of a file. The second name is the twin, or a folder to put it in.copy notes.txt notes-backup.txtLesson 16
movealso mv, Move-ItemTakes a file on a trip into another folder. It leaves where it was.move notes.txt backupsLesson 16
renalso Rename-ItemGives a file a new name in the same folder.ren list.txt shopping.txtLesson 16
rmalso del, Remove-ItemDeletes for good: the terminal has no recycle bin. Look with dir first.rm junk\old-1.txtLesson 17
-WhatIfA parameter: says what a command would do, and does nothing.rm notes.txt -WhatIfLesson 18
Help and programs
CommandWhat it doesExampleLearn itTry
helpalso Get-HelpShows a command and the parts it takes.help copyLesson 18
Get-Aliasalso galSays which real command a nickname (an alias) runs.Get-Alias lsLesson 19
pythonalso pyRuns a Python program: a .py file full of steps.python hello.pyLesson 22
Key tricks
CommandWhat it doesExampleLearn itTry
TabFinishes a file or folder name for you. Type the start, then press Tab.cd DocLesson 13
↑Brings back the last command, ready to run again.↑Lesson 13
Ctrl+CThe emergency stop: cancels the line, or stops a program that runs forever.Ctrl+CLesson 13
Git save pointsStart with git init: the other Git commands need a Git project, so try them in order (init, status, add, commit, log).
CommandWhat it doesExampleLearn itTry
git initMakes this folder a Git project (a repository), with a hidden .git folder for its save points.git initLesson 52
git statusSays what changed: new files, changed files, and what is picked to save.git statusLesson 52
git addPicks files for the next save point. A dot picks everything here.git add .Lesson 53
git commit -mMakes a save point of the picked files, with a note saying what changed.git commit -m "Add my ideas"Lesson 53
git logalso --onelineShows the save points, newest first.git log --onelineLesson 53
git diffShows what changed since the last save, line by line: red out, green in.git diffLesson 54
git restoreUndoes the changes to a file since the last save point.git restore index.htmlLesson 54
git checkoutVisits an old save point. git switch main brings you back.git checkout HEAD~2Lesson 54
git switchalso -cGoes to a branch. With -c it makes a new branch first.git switch -c dark-modeLesson 55
git mergeBrings a branch's save points into the branch you are on.git merge dark-modeLesson 55
git pushalso git remote addSends your save points to GitHub (on the practice computer, a pretend one).git push -u origin mainLesson 56
.gitignoreA list of files Git must skip, like secrets and keys. On a real computer, make it in a text editor saved as UTF-8: Windows PowerShell 5.1's > writes a kind of text Git cannot read.echo secrets.txt > .gitignoreLesson 57
⌨️ Practice terminal: try any command from the sheet
Try:

Side by side: PowerShell, CMD and Mac

Windows offers PowerShell and Command Prompt (CMD), and a Mac or Linux terminal speaks a third dialect. Here are twelve everyday jobs in all three, so a command from a book or a forum can be matched to the window in front of you.

One warning: the PowerShell short names, such as ls, cat and rm, are set up on Windows only. In PowerShell on a Mac or Linux, ls runs the computer’s own ls program instead.

JobPowerShell (Windows)CMDMac or Linux
Where am I?pwdcd on its ownpwd
List what is heredir or lsdirls
Walk into a folder, then outcd images, cd ..cd images, cd ..cd images, cd ..
Make a foldermkdir clubmd clubmkdir club
Make an empty fileni ideas.txttype nul >> ideas.txttouch ideas.txt
Show what a file sayscat story.txt or type story.txttype story.txtcat story.txt
Copy a filecopy story.txt story-2.txtcopy story.txt story-2.txtcp story.txt story-2.txt
Move a file into a foldermove story.txt clubmove story.txt clubmv story.txt club
Rename a fileren todo.txt jobs.txtren todo.txt jobs.txtmv todo.txt jobs.txt
Delete a filerm old.txt or del old.txtdel old.txtrm old.txt
Clear the screencls or clearclsclear
Get help on a commandGet-Help Copy-Itemhelp copyman cp

PowerShell or CMD: which one am I in? · Lesson 19: Dialects: PowerShell, CMD, Mac

Key tricks: Tab, the Up arrow and Ctrl+C

Tab, the Up and Down arrows and Ctrl+C also work in the practice terminal; Shift+Tab and Ctrl+R need a real PowerShell window.

  • Tab finishes a name you have started: enter cd im, press Tab, and it becomes cd .\images\. Press it again for the next match, or Shift+Tab to step back.
  • The Up arrow brings back your last command, to run again or mend. Press it again for older ones; the Down arrow comes forward.
  • Ctrl+R searches your history: press it, then enter a few letters of an earlier command.
  • Ctrl+C is the emergency stop: it interrupts a command that keeps waiting and cancels a half-written line (selected text gets copied instead). In a Mac’s Terminal, Apple gives Control-C the same stopping job.

Lesson 13: Speed tricks · Lesson 21: Stop signs

Safe habits before you press Enter

  • Look first: pwd names your folder and dir shows what is in it. A path is a home address, so check the street before you deliver.
  • Rehearse with -WhatIf at the end of a command. PowerShell reports what would happen and changes nothing, so rm notes.txt -WhatIf leaves notes.txt where it was.
  • Treat delete as final. In PowerShell, rm, del and Remove-Item are one command, and what it removes skips the Recycle Bin. Copy precious files somewhere safe first.
  • Mind the second name when copying: copy (Copy-Item) replaces a file of that name without asking.
  • Stay in an ordinary window, since nothing here needs Run as administrator, and skip any command you cannot explain, whoever suggested it.

Lesson 17: Delete carefully · Lesson 18: Commands have parts

Save points with Git: the first five commands

Git keeps save points for a project folder, so you can look back at earlier versions of your work. In the practice terminal, these five in order make your first save point, with nothing to install. The sheet above also lists the next steps: git diff, git restore, branches and git push.

CommandWhat it does
git initTurns this folder into a new Git repository
git statusShows what you are in the middle of doing
git add .Picks everything under this folder for the next save point
git commit -m "First save"Makes the save point, with a note saying what changed
git logShows what happened: the save points and their notes

Lesson 52: Why save points? · Lesson 53: Your first commit

Printing the sheet, or saving it as a PDF

Press Print the cheat sheet, above the tables. The paper copy keeps every group of commands and leaves out the Try buttons and the practice terminal; the rest of this page, side-by-side table included, prints after it. For a file instead of paper, look for Save as PDF in your browser’s print window.

How to read a row of the sheet

Each row gives the command, any other names it answers to in small print, what it does in a sentence or two, an example and the lesson that teaches it. On a narrow screen such as a phone, the example and lesson columns fold away.

Rows come in six groups, from moving around to Git save points. Keys, and a few Git commands that need earlier steps first, have no Try button. It all runs in your browser, free, with no account.

Open the full practice terminal · Race the commands in Command Racer · PowerShell for beginners

Questions and answers

What are the basic PowerShell commands?

A dozen cover most beginner work: pwd (Get-Location), dir (Get-ChildItem), cd (Set-Location), mkdir, ni (New-Item), cat (Get-Content), copy (Copy-Item), move (Move-Item), ren (Rename-Item), rm (Remove-Item), cls (Clear-Host) and Get-Help. The short names are aliases for the full names in brackets.

Is there a PowerShell cheat sheet PDF?

This page turns into one. Press Print the cheat sheet, then choose Save as PDF in your browser’s print window if it offers that. You get the whole sheet, each command with its meaning and lesson, minus the buttons, and can print a fresh copy whenever the course adds a command.

How do I see a list of PowerShell aliases?

Run Get-Alias to list the aliases in your PowerShell session. For one command’s nicknames, give its full name: on Windows, Get-Alias -Definition Get-ChildItem shows dir, gci and ls. To learn what one nickname runs, name it, as in Get-Alias ls, which works in the practice terminal too.

What is the difference between rm and del in PowerShell?

On Windows, none. Both are aliases for Remove-Item, along with erase, ri, rd and rmdir. Whichever name you use, the file skips the Recycle Bin, so look with dir first and rehearse with -WhatIf, which reports what would be deleted and deletes nothing.

How do I stop a command in PowerShell?

Press Ctrl+C. It interrupts a command that keeps running, such as one waiting for a file to change. On a half-written line it cancels the line, which stays on screen unrun, and gives you a fresh prompt. With text selected, Ctrl+C copies it instead, so clear the selection first.

Sources

The facts on this page were checked against these pages (14 November 2026):

More guides

DayOneCode is an independent learning site, not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic.