root@sparrow:~/writeups$ cat guia-comandos-powershell.md
// tools
Basic PowerShell & CMD Commands
22 Jul 2026
· 2 min read
A reference for basic CMD and PowerShell commands — the Windows equivalent of the Linux commands cheat sheet. Includes the equivalent of each typical action (navigation, processes, network) in both shells, since on real machines you can run into either one.
| Type | Command reference |
| Shells | CMD (command prompt) and PowerShell |
CMD — basic commands
| Task | CMD command | Description |
|---|---|---|
| List folder contents | dir | Lists files and folders |
| Change directory | cd folder_name | Enters a folder |
| Go up one level | cd .. | Returns to the parent folder |
| Clear screen | cls | Clears the console |
| Create/remove folder | mkdir name / rmdir name | Creates or removes an empty folder |
| Delete a file | del file.txt | Deletes a file |
| Copy / move files | copy source dest / move source dest | Copies or moves/renames |
| Show current path | cd | Shows the current directory |
| View network config | ipconfig | IP addresses and interfaces |
| View active processes | tasklist | List of running processes |
| Kill a process | taskkill /IM name.exe /F | Closes a process by name |
| View a file's content | type file.txt | Shows the file's text |
| System information | systeminfo | Windows version, hotfixes, etc. |
| Active connections/ports | netstat | Network status |
| View current privileges | whoami /priv | Current user's permissions |
Viewing saved WiFi passwords (CMD, as admin)
for /f "skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show profiles') do @echo SSID: %j & netsh wlan show profile name=%j key=clear | findstr /C:"Key Content"
PowerShell — basic commands
PowerShell uses cmdlets with the Verb-Noun structure (e.g. Get-Process, Set-Location, New-Item).
| Task | PowerShell command | Description |
|---|---|---|
| List folder contents | Get-ChildItem / ls | Lists files and folders |
| Change directory | Set-Location name / cd name | Enters a folder |
| Clear screen | Clear-Host / cls | Clears the console |
| Create a folder | New-Item -ItemType Directory -Name name | Creates a folder |
| Delete folder/file | Remove-Item name -Recurse | Deletes a folder (with content) or file |
| Copy / move files | Copy-Item source dest / Move-Item source dest | Copies or moves/renames |
| Show current path | Get-Location | Current directory |
| View IP address | Get-NetIPAddress | Network configuration |
| View active processes | Get-Process | List of processes |
| Kill a process | Stop-Process -Name name | Closes a process |
| Test connectivity | Test-Connection google.com | Network test |
| View services | Get-Service | System services |
| Help for a cmdlet | Get-Help <cmdlet> | Built-in documentation |
Useful shortcuts
| Shortcut | Action |
|---|---|
| Ctrl + L | Clears the screen |
| Ctrl + C | Stops or cancels the running command |