Equivalent Windows and UNIX Commands
Cross-reference of common commands between *NIX (Linux/macOS) shells and Windows cmd.exe. Useful when moving between platforms during an engagement or writing cross-platform runbooks.
Command equivalencies
| *NIX | Windows |
|---|---|
cat | type |
dig | nslookup |
grep | findstr / Select-String (PowerShell) |
ifconfig / ip addr | ipconfig |
ls | dir |
more | more |
netstat | netstat |
ping | ping |
shutdown | shutdown |
sleep | timeout |
sudo | runas |
tcpdump | windump / pktmon |
traceroute | tracert |
wget | wget (PowerShell alias → Invoke-WebRequest on some builds) |
hostname | hostname |
whoami | whoami |
Shell operators that translate
| Operation | *NIX | Windows |
|---|---|---|
| Redirect stdout to file | > | > |
| Pipe between commands | | | | |
| Run sequentially, stop on failure | && | && (cmd, modern) |
| Run sequentially regardless | ; | & |
Gotchas
find≠find: Windowsfindis a string-search filter (like a weakgrep), not the UNIX file-search tool. The UNIX-style tool on Windows isdir /s /bor PowerShellGet-ChildItem -Recurse. See findstr for the realgrepanalogue.- Aliases in PowerShell:
ls,cat,sleep,wget, andcurlare aliases to PowerShell cmdlets with different flags — scripts written forcmd.exemay silently change behavior under PowerShell. - Case sensitivity: Windows paths are case-insensitive; *NIX paths are not.
Sources
- Microsoft Learn — Windows commands reference
- Super User — Windows equivalent of `cat`
- SS64 — CMD commands
Related: findstr, net-windows-command, windows-reconnaissance-commands, linux-reconnaissance-commands, powershell-run-commands