Windows & Linux Commands
Command comparison reference - Essential command-line equivalents for Windows Command Prompt, PowerShell, and Linux terminals.
About Command Line Interfaces
Command-line interfaces (CLI) provide direct text-based access to operating system functions and are essential for system administration.
- Windows: Command Prompt (cmd), PowerShell, Windows Terminal
- Linux: Bash, Zsh, Fish shells with terminal emulators
- Essential for automation, remote administration, and advanced system management
Command Converter
File Operations
List: dir (Win) / ls (Linux)
Copy: copy/xcopy (Win) / cp (Linux)
Move: move (Win) / mv (Linux)
Delete: del (Win) / rm (Linux)
Network Commands
Ping: ping (Both)
IP Config: ipconfig (Win) / ifconfig (Linux)
DNS Lookup: nslookup (Both)
Trace Route: tracert (Win) / traceroute (Linux)
System Information
System Info: systeminfo (Win) / uname (Linux)
Processes: tasklist (Win) / ps (Linux)
Disk Usage: dir (Win) / df (Linux)
Memory: systeminfo (Win) / free (Linux)
User Management
Current User: whoami (Both)
User List: net user (Win) / users (Linux)
Groups: net localgroup (Win) / groups (Linux)
Switch User: runas (Win) / su (Linux)
Complete Command Comparison
Function | Windows (CMD) | Windows (PowerShell) | Linux | Description |
---|---|---|---|---|
List Directory Contents | dir | Get-ChildItem | ls -la | Display files and directories |
Change Directory | cd | Set-Location | cd | Navigate to different directory |
Create Directory | mkdir | New-Item -Type Directory | mkdir | Create new directory |
Copy Files | copy | Copy-Item | cp | Copy files or directories |
Move/Rename Files | move | Move-Item | mv | Move or rename files |
Delete Files | del | Remove-Item | rm | Delete files or directories |
Display File Content | type | Get-Content | cat | Show contents of text file |
Find Text in Files | findstr | Select-String | grep | Search for text patterns |
Network Configuration | ipconfig | Get-NetIPConfiguration | ifconfig | Display network settings |
Test Network Connectivity | ping | Test-NetConnection | ping | Check network connectivity |
Display Running Processes | tasklist | Get-Process | ps aux | Show active processes |
Kill Process | taskkill | Stop-Process | kill | Terminate running process |
System Information | systeminfo | Get-ComputerInfo | uname -a | Display system details |
Current User | whoami | $env:USERNAME | whoami | Show current user name |
Environment Variables | set | Get-ChildItem Env: | env | Display environment variables |
Disk Usage | dir | Get-PSDrive | df -h | Show disk space usage |
Archive/Extract | compact | Compress-Archive | tar | Create or extract archives |
Schedule Tasks | schtasks | Register-ScheduledTask | crontab | Schedule automated tasks |