Bash vs PowerShell Cheat Sheet#
Operation |
Bash (Unix) |
PowerShell |
Description |
---|---|---|---|
List files |
|
|
Show directory contents |
Change directory |
|
|
Navigate directories |
Copy files |
|
|
Copy files or directories |
Move files |
|
|
Move or rename files |
Remove files |
|
|
Delete files or directories |
Create directory |
|
|
Create new directory |
Show file content |
|
|
Display file contents |
Find text |
|
|
Search for text patterns |
Current location |
|
|
Show current directory |
Clear screen |
|
|
Clear terminal screen |
Compare files |
|
|
Compare file contents |
Process list |
|
|
List running processes |
Kill process |
|
|
Terminate process |
Network info |
|
|
Show network configuration |
Permission change |
|
|
Change file permissions |
View file tail |
|
|
Show end of file |
System info |
|
|
Display system information |
Note: PowerShell commands in parentheses are aliases that make PowerShell feel more familiar to Bash users. PowerShell commands are not case-sensitive, while Bash commands are.
Common tips:
PowerShell uses verb-noun naming convention (e.g.,
Get-Process
)PowerShell aliases allow Unix-style commands to work
PowerShell commands can output objects, while Bash outputs text streams
Both shells support pipeline operations, but PowerShell pipes objects rather than text