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.
| Job | PowerShell (Windows) | CMD | Mac or Linux |
|---|---|---|---|
| Where am I? | pwd | cd on its own | pwd |
| List what is here | dir or ls | dir | ls |
| Walk into a folder, then out | cd images, cd .. | cd images, cd .. | cd images, cd .. |
| Make a folder | mkdir club | md club | mkdir club |
| Make an empty file | ni ideas.txt | type nul >> ideas.txt | touch ideas.txt |
| Show what a file says | cat story.txt or type story.txt | type story.txt | cat story.txt |
| Copy a file | copy story.txt story-2.txt | copy story.txt story-2.txt | cp story.txt story-2.txt |
| Move a file into a folder | move story.txt club | move story.txt club | mv story.txt club |
| Rename a file | ren todo.txt jobs.txt | ren todo.txt jobs.txt | mv todo.txt jobs.txt |
| Delete a file | rm old.txt or del old.txt | del old.txt | rm old.txt |
| Clear the screen | cls or clear | cls | clear |
| Get help on a command | Get-Help Copy-Item | help copy | man 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 becomescd .\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.
Safe habits before you press Enter
- Look first:
pwdnames your folder anddirshows what is in it. A path is a home address, so check the street before you deliver. - Rehearse with
-WhatIfat the end of a command. PowerShell reports what would happen and changes nothing, sorm notes.txt -WhatIfleaves notes.txt where it was. - Treat delete as final. In PowerShell,
rm,delandRemove-Itemare 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.
| Command | What it does |
|---|---|
git init | Turns this folder into a new Git repository |
git status | Shows 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 log | Shows what happened: the save points and their notes |
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):
- Microsoft Learn: Using aliases (CMD, Unix and PowerShell names side by side; these aliases are Windows-only, so ls runs the native command on macOS and Linux; Get-Alias and -Definition)
- Microsoft Learn: about_FileSystem_Provider, 5.1 (the mkdir function; Copy-Item overwrites without asking; Ctrl+C interrupts Get-Content -Wait; Get-Help followed by a cmdlet name)
- Microsoft Learn: about_PSReadLine_Functions (Windows-mode keys: Tab, Shift+Tab, the Up and Down arrows, Ctrl+R; Ctrl+C copies a selection, otherwise cancels the line)
- Microsoft Learn: cd in CMD (used alone, it shows the current folder; cd .. goes to the parent)
- Microsoft Learn: help in CMD (help followed by a command name shows its details)
- SS64: TYPE in CMD (TYPE nul makes an empty file)
- Apple Developer: Command Line Primer (ls, cd, pwd, mkdir, cat, cp, mv also renames, rm, man; Control-C stops a running program)
- Linux man-pages: touch (a file that does not exist is created empty)
- Netwrix (2025): items deleted with Remove-Item are not sent to the Recycle Bin; -WhatIf simulates the command without making changes
- Git documentation: giteveryday (init creates a repository, status, add . adds everything under the current folder, commit -m, log shows what happened)
More guides
- Coding for kids
Free coding for kids from about 9: real commands in a pretend terminal, two kid guides, stars and certificates. No account, no ads in lessons, nothing to install.
- Coding for beginners
Coding for beginners in the order that works: files, paths and the terminal first, then Python, web pages, Git and AI agents. Free, in your browser, no install.
- PowerShell for beginners
PowerShell for beginners, in plain words: what it is, how to open it without admin rights, how Verb-Noun names and aliases work, and where to get help. Try it free.
- Python for kids
Python for kids, free in your browser: first programs, loops and a Guess the Number game. No sign-up, nothing to install and never any ads.
- The DayOneCode blog
Plain answers to the questions every new coder asks.