The cmd and PowerShell commands you will actually use, each with a one-line description. Print it and keep it by your keyboard.
Windows has two command shells: Command Prompt (cmd), the older shell, and PowerShell, the newer one. Both are built into Windows, and both open from the Start menu or with Win+X. Every command below is real and ships with Windows. Run Command Prompt or PowerShell as administrator for commands that change system settings.
| Command | What it does |
|---|---|
dir | Lists the files and folders in the current folder |
cd folder | Moves into a folder; cd .. moves up one level |
mkdir name | Creates a new folder |
rmdir name | Deletes an empty folder; add /s to delete it with its contents |
copy source destination | Copies a file |
move source destination | Moves a file, or renames it when the destination is a new name in the same folder |
ren old new | Renames a file or folder |
del file | Deletes a file |
type file | Shows the contents of a text file |
tree | Shows the folder structure as a tree |
attrib file | Shows or changes file attributes such as read-only and hidden |
xcopy source destination | Copies files and folders, including subfolders with /s |
robocopy source destination | Copies whole folders reliably, with resume and mirroring options |
| Command | What it does |
|---|---|
Get-ChildItem | Lists files and folders; the alias ls works too |
Set-Location folder | Moves into a folder; the alias cd works too |
New-Item -ItemType Directory -Name name | Creates a new folder |
Copy-Item source destination | Copies a file or folder |
Move-Item source destination | Moves or renames a file or folder |
Remove-Item file | Deletes a file or folder; add -Recurse for a folder with contents |
Rename-Item old new | Renames a file or folder |
Get-Content file | Shows the contents of a text file; the alias cat works too |
Set-Content file -Value "text" | Writes text into a file, replacing what was there |
Test-Path path | Checks whether a file or folder exists, returning True or False |
| Command | Shell | What it does |
|---|---|---|
ipconfig | cmd | Shows your IP address, subnet mask, and gateway |
ipconfig /all | cmd | Shows full network details, including DNS servers and MAC address |
ipconfig /flushdns | cmd | Clears the DNS cache, which can fix sites that load the wrong address |
ping address | cmd | Checks whether a computer or site responds, and how fast |
tracert address | cmd | Shows each hop a connection takes to reach an address |
nslookup domain | cmd | Looks up the IP address for a domain name |
netstat -ano | cmd | Lists open connections and which process owns each one |
Test-Connection address | PowerShell | PowerShell version of ping, with richer output |
Get-NetIPAddress | PowerShell | Shows the IP addresses on this computer |
Get-NetAdapter | PowerShell | Lists network adapters and their status |
| Command | Shell | What it does |
|---|---|---|
systeminfo | cmd | Shows Windows version, install date, memory, and more |
hostname | cmd | Shows this computer's name |
whoami | cmd | Shows the current user name |
ver | cmd | Shows the Windows version number |
tasklist | cmd | Lists running processes |
taskkill /PID id /F | cmd | Force-stops the process with the given ID; find the ID with tasklist |
sfc /scannow | cmd, as admin | Scans and repairs protected Windows system files |
chkdsk /f | cmd, as admin | Checks the disk for errors and fixes them; may ask to run at the next restart |
driverquery | cmd | Lists installed device drivers |
net user | cmd | Lists the user accounts on this computer |
Get-ComputerInfo | PowerShell | Shows detailed system information |
Get-Process | PowerShell | Lists running processes |
Stop-Process -Name name | PowerShell | Stops a running process by name |
Get-Service | PowerShell | Lists Windows services and whether each is running |
Get-Disk | PowerShell | Lists physical disks and their size and health status |
| Command | Shell | What it does |
|---|---|---|
shutdown /s /t 0 | cmd | Shuts the computer down immediately |
shutdown /r /t 0 | cmd | Restarts the computer immediately |
shutdown /a | cmd | Cancels a shutdown that is counting down |
Stop-Computer | PowerShell | Shuts the computer down |
Restart-Computer | PowerShell | Restarts the computer |
del, Remove-Item, and rmdir /s do not send files to the Recycle Bin. Double-check the path before you press Enter, especially with wildcards such as *.How do I open Command Prompt or PowerShell as administrator? Right-click the Start button and choose Terminal (Admin), or search for Command Prompt or PowerShell in the Start menu, right-click it, and choose Run as administrator. Some commands, such as sfc /scannow and chkdsk /f, only work from an elevated window.
What is the difference between Command Prompt and PowerShell? Command Prompt is the older shell with simple text commands. PowerShell is the newer shell: its commands return structured objects instead of plain text, so you can filter and sort results, and it works across Windows, macOS, and Linux. For everyday file and network checks, either one works.
Why does a command say it is not recognized? The usual causes are a typo, a command that belongs to the other shell, or a program that is not installed or not on the PATH. Check the spelling first, then check whether the command is a cmd command or a PowerShell command.