Bash to Powershell Cheatsheet
Bash to PowerShell Cheatsheet: A quick reference guide to help you translate common Bash commands into their PowerShell equivalents—and vice versa.
Ideal for developers, sysadmins, or anyone transitioning between Linux and Windows environments.
File Operations
| Operation | Bash | PowerShell |
|---|---|---|
List files in a directory |
|
|
Change directory |
|
|
Copy a file |
|
|
Move a file |
|
|
Delete a file |
|
|
Create a directory |
|
|
Delete a directory |
|
|
Text Processing
| Operation | Bash | PowerShell |
|---|---|---|
Print text to the console |
|
|
Read a file |
|
|
Find text in a file |
|
|
Replace text in a file |
| `(Get-Content <file>) -replace 'old', 'new' |
System Information
| Operation | Bash | PowerShell |
|---|---|---|
Display current user |
|
|
Display system information |
|
|
Display environment variables |
|
|
Network Operations
| Operation | Bash | PowerShell |
|---|---|---|
Display IP address |
|
|
Test network connection |
|
|
Display network configuration |
|
|
Package Management
| Operation | Bash | PowerShell |
|---|---|---|
Install a package |
|
|
Update package list |
|
|
Upgrade all packages |
|
|