Blog
Command Line cheat sheet: LINUX --> WINDOWS CMD --> POWERSHELL
by Dragon on 2026-06-03 13:32:55 UTC
I used Microsoft Copilot to translate common Linux commands into Windows CMD and Powershell equivalents: =============================================================================================== LINUX --> WINDOWS CMD --> POWERSHELL (SHORTCUTS + EXPLICIT) =============================================================================================== ---------------------------------------------------------------------------- NAVIGATION ---------------------------------------------------------------------------- Linux | Windows CMD | PowerShell Shortcuts | PowerShell --------------------+-------------------+-------------------------+--------------------------------------- ls | dir | ls | Get-ChildItem pwd | cd | pwd | Get-Location cd /path | cd \path | cd path | Set-Location path cd .. | cd .. | cd .. | Set-Location .. ---------------------------------------------------------------------------- FILE OPERATIONS ---------------------------------------------------------------------------- Linux | Windows CMD | PowerShell Shortcuts | PowerShell --------------------+-------------------+-------------------------+--------------------------------------- touch file | type nul > file | ni file.ext | New-Item file.ext -ItemType File cp src dst | copy src dst | cp src dst | Copy-Item src dst mv src dst | move src dst | mv src dst | Move-Item src dst rm file | del file | rm file | Remove-Item file rm -r dir | rmdir /s dir | rm dir -r -force | Remove-Item dir -Recurse -Force echo text >> file | echo text >> file | echo text >> file | Add-Content filename.txt "your text" ---------------------------------------------------------------------------- DIRECTORY OPS ---------------------------------------------------------------------------- Linux | Windows CMD | PowerShell Shortcuts | PowerShell --------------------+-------------------+-------------------------+--------------------------------------- mkdir name | mkdir name | mkdir name | New-Item name -ItemType Directory rmdir name | rmdir name | rm name | Remove-Item name ---------------------------------------------------------------------------- VIEWING & SEARCHING ---------------------------------------------------------------------------- Linux | Windows CMD | PowerShell Shortcuts | PowerShell --------------------+-------------------+-------------------------+--------------------------------------- cat file | type file | gc file | Get-Content file grep "txt" file | find "txt" file | sls "txt" file | Select-String "txt" file grep -r "txt" dir | findstr /s /i | sls "txt" dir -r | Select-String -Pattern "txt" -Recurse ---------------------------------------------------------------------------- SYSTEM & PROCESSES ---------------------------------------------------------------------------- Linux | Windows CMD | PowerShell Shortcuts | PowerShell --------------------+-------------------+-------------------------+--------------------------------------- ps | tasklist | gps | Get-Process kill PID | taskkill /PID | kill PID | Stop-Process -Id PID top | tasklist | gps | sort CPU -desc | Get-Process | Sort-Object CPU -Descending df -h | wmic logicaldisk | gdr | Get-PSDrive free -h | systeminfo | (none) | Get-CimInstance Win32_OperatingSystem ---------------------------------------------------------------------------- NETWORKING ---------------------------------------------------------------------------- Linux | Windows CMD | PowerShell Shortcuts | PowerShell --------------------+-------------------+-------------------------+--------------------------------------- ifconfig / ip a | ipconfig | (none) | Get-NetIPAddress ping host | ping host | ping host | Test-Connection host traceroute host | tracert host | tnc host -traceroute | Test-NetConnection host -TraceRoute curl url | curl url | curl url | Invoke-WebRequest url wget url | curl -O url | iwr url -OutFile file | Invoke-WebRequest url -OutFile file ---------------------------------------------------------------------------- PERMISSIONS ---------------------------------------------------------------------------- Linux | Windows CMD | PowerShell Shortcuts | PowerShell --------------------+-------------------+-------------------------+--------------------------------------- chmod | icacls | (none) | Set-Acl chown | icacls | (none) | Set-Acl ---------------------------------------------------------------------------- ENVIRONMENT VARIABLES ---------------------------------------------------------------------------- Linux | Windows CMD | PowerShell Shortcuts | PowerShell --------------------+-------------------+-------------------------+--------------------------------------- echo $VAR | echo %VAR% | echo $env:VAR | Write-Output $env:VAR export VAR=val | set VAR=val | $env:VAR="val" | $env:VAR = "value" ---------------------------------------------------------------------------- MISC ---------------------------------------------------------------------------- Linux | Windows CMD | PowerShell Shortcuts | PowerShell --------------------+-------------------+-------------------------+--------------------------------------- clear | cls | clear | Clear-Host man cmd | cmd /? | help cmd | Get-Help cmd 2026-03-28 03:24 UTC