Cheat Sheet
The commands you keep forgetting, with a one-line description and a real example you can copy - 384 across 26 tools. Pick a tool in the sidebar, or search across all of them.
PowerShell
The Windows shell - files, processes, and the object pipeline (Unix aliases in parens).| Command | What it does | Example |
|---|---|---|
Get-ChildItem (ls) | List a directory. | Get-ChildItem -Force |
Set-Location (cd) | Change directory. | Set-Location C:\Projects |
Get-Content (cat) | Read a file; -Tail for the end. | Get-Content app.log -Tail 20 |
Copy-Item (cp) | Copy a file or folder. | Copy-Item file.txt backup.txt |
Move-Item (mv) | Move or rename. | Move-Item old.txt new.txt |
Remove-Item (rm) | Delete; -Recurse -Force for folders. | Remove-Item -Recurse -Force build |
New-Item | Create a file or directory. | New-Item -ItemType Directory src |
Select-String (grep) | Search text in files. | Select-String "error" app.log |
Get-Process (ps) | List running processes. | Get-Process | Sort-Object CPU -Descending |
Stop-Process | Kill a process. | Stop-Process -Name node -Force |
Where-Object | Filter objects in the pipeline. | Get-Process | Where-Object CPU -gt 100 |
ForEach-Object | Loop over pipeline items ($_ is each). | 1..3 | ForEach-Object { $_ * 2 } |
$env: | Read an environment variable. | $env:PATH |
Get-Command (which) | Find where a command lives. | (Get-Command node).Source |
Invoke-WebRequest | Make an HTTP request. | Invoke-WebRequest https://api.github.com |