// CyberGrind · Orange Book · OS Infographic Series — 07 of 09
cmd.exe legacy commands + PowerShell 7 object-oriented cmdlets — with aliases, flags, and real-world patterns.
Sort-Object CPU sorts numerically on the actual CPU property. No awk/grep needed. cmd.exe works on plain text; PowerShell works on structured data.Set-Location C:\pathcd ~ for home. Use cd - to go back.Get-ChildItem -Path . -RecurseNew-Item -ItemType Directory logsCopy-Item src -Destination dst\Remove-Item file.txt -ForceGet-Content file.txt -Tail 20Select-String -Pattern "error" *.log... | Where-Object {$_ -match "x"}... | Sort-Object CPU -Descending... | Measure-Object -Line -WordGet-Process [name]Stop-Process -Id 1234 -ForceGet-Service | Restart-ServiceGet-NetTCPConnection -State ListenTest-NetConnection host -Port 443Invoke-WebRequest https://api.site.com| Task | cmd.exe | PowerShell |
|---|---|---|
| List files | dir | Get-ChildItem / ls |
| Change dir | cd path | Set-Location / cd |
| Print file | type file.txt | Get-Content / cat |
| Copy | copy src dst | Copy-Item / cp |
| Delete | del file.txt | Remove-Item / rm |
| Search text | findstr "x" file | Select-String "x" file |
| List processes | tasklist | Get-Process |
| Kill process | taskkill /PID 1234 /F | Stop-Process -Id 1234 |
| Network info | ipconfig /all | Get-NetIPConfiguration |
| Env variable | %VARNAME% | $env:VARNAME |
| Clear screen | cls | Clear-Host / cls |