CMD vs PowerShell Cheatsheet

CMD vs PowerShell
List files Files
CMD
dir
PowerShell
Get-ChildItem (ls)
List files with details Files
CMD
dir /a
PowerShell
Get-ChildItem -Force
Change directory Files
CMD
cd <dir>
PowerShell
Set-Location <dir> (cd)
Print current directory Files
CMD
cd
PowerShell
Get-Location (pwd)
Create directory Files
CMD
mkdir <dir>
PowerShell
New-Item -ItemType Directory <dir>
Remove file Files
CMD
del <file>
PowerShell
Remove-Item <file> (rm)
Remove directory Files
CMD
rmdir /s /q <dir>
PowerShell
Remove-Item -Recurse -Force <dir>
Copy file Files
CMD
copy <src> <dst>
PowerShell
Copy-Item <src> <dst> (cp)
Copy directory Files
CMD
xcopy <src> <dst> /s /e
PowerShell
Copy-Item -Recurse <src> <dst>
Move/rename file Files
CMD
move <src> <dst>
PowerShell
Move-Item <src> <dst> (mv)
Show file contents Files
CMD
type <file>
PowerShell
Get-Content <file> (cat)
Create empty file Files
CMD
type nul > <file>
PowerShell
New-Item <file>
Find text in file Files
CMD
findstr "text" <file>
PowerShell
Select-String "text" <file>
Find files by name Files
CMD
dir /s /b *name*
PowerShell
Get-ChildItem -Recurse -Filter *name*
Clear screen System
CMD
cls
PowerShell
Clear-Host (cls)
Show date/time System
CMD
date /t && time /t
PowerShell
Get-Date
System info System
CMD
systeminfo
PowerShell
Get-ComputerInfo
Hostname System
CMD
hostname
PowerShell
$env:COMPUTERNAME
Current user System
CMD
whoami
PowerShell
$env:USERNAME
Environment variables System
CMD
set
PowerShell
Get-ChildItem Env:
Set env variable System
CMD
set VAR=value
PowerShell
$env:VAR = "value"
Command history System
CMD
doskey /history
PowerShell
Get-History
Shutdown PC System
CMD
shutdown /s /t 0
PowerShell
Stop-Computer
Restart PC System
CMD
shutdown /r /t 0
PowerShell
Restart-Computer
Ping host Network
CMD
ping <host>
PowerShell
Test-Connection <host>
Show IP config Network
CMD
ipconfig
PowerShell
Get-NetIPAddress
Show IP (detailed) Network
CMD
ipconfig /all
PowerShell
Get-NetIPConfiguration
Flush DNS Network
CMD
ipconfig /flushdns
PowerShell
Clear-DnsClientCache
DNS lookup Network
CMD
nslookup <host>
PowerShell
Resolve-DnsName <host>
Show open ports Network
CMD
netstat -an
PowerShell
Get-NetTCPConnection
Trace route Network
CMD
tracert <host>
PowerShell
Test-Connection -Traceroute <host>
Download file Network
CMD
curl -O <url>
PowerShell
Invoke-WebRequest <url> -OutFile <file>
List processes Processes
CMD
tasklist
PowerShell
Get-Process
Kill process by name Processes
CMD
taskkill /im <name> /f
PowerShell
Stop-Process -Name <name> -Force
Kill process by PID Processes
CMD
taskkill /pid <pid> /f
PowerShell
Stop-Process -Id <pid> -Force
Start a program Processes
CMD
start <program>
PowerShell
Start-Process <program>
List services Processes
CMD
sc query
PowerShell
Get-Service
Start service Processes
CMD
net start <svc>
PowerShell
Start-Service <svc>
Stop service Processes
CMD
net stop <svc>
PowerShell
Stop-Service <svc>
Show disk space Disk
CMD
wmic logicaldisk get size,freespace,caption
PowerShell
Get-PSDrive -PSProvider FileSystem
Show directory size Disk
CMD
dir /s <dir>
PowerShell
(Get-ChildItem -Recurse | Measure-Object Length -Sum).Sum
Format drive Disk
CMD
format <drive>: /fs:ntfs
PowerShell
Format-Volume -DriveLetter <drive>
Showing 42 of 42 commands

CMD vs PowerShell Cheatsheet

A side-by-side comparison of Windows CMD and PowerShell commands. Search by task name or command to find the equivalent instantly. Perfect for switching between CMD and PowerShell.

About this cheatsheet

This cheatsheet shows CMD and PowerShell equivalents for common Windows tasks, organized by category.

  • 40+ task equivalents between CMD and PowerShell
  • Side-by-side comparison layout
  • Filter by category (Files, System, Network, Processes, Disk)
  • Full-text search across tasks and commands
  • Copy CMD or PowerShell command independently

100% free. No signup required. No data collected or sent anywhere.

Explore All Tools