PowerShell to Unix Command Reference Guide
File and Directory Operations
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Get-ChildItem |
gci , ls , dir |
ls |
List files and directories |
Set-Location |
sl , cd , chdir |
cd |
Change current directory |
Get-Location |
gl , pwd |
pwd |
Get current working directory |
New-Item |
ni |
touch , mkdir |
Create new file or directory |
Remove-Item |
ri , rm , del , erase , rmdir , rd |
rm , rmdir |
Delete files or directories |
Copy-Item |
ci , cp , copy |
cp |
Copy files or directories |
Move-Item |
mi , mv , move |
mv |
Move/rename files or directories |
Rename-Item |
rni , ren |
mv |
Rename files or directories |
Test-Path |
N/A | test , [ -e ] |
Test if path exists |
Split-Path |
N/A | dirname , basename |
Split path into components |
Join-Path |
N/A | N/A (concatenation) | Join path components |
Resolve-Path |
rvpa |
realpath |
Resolve relative paths to absolute |
File Content Operations
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Get-Content |
gc , cat , type |
cat , less , more |
Display file contents |
Set-Content |
sc |
> (redirect) |
Write content to file (overwrite) |
Add-Content |
ac |
>> (append) |
Append content to file |
Out-File |
N/A | > , tee |
Send output to file |
Select-String |
sls |
grep |
Search text patterns in files |
Sort-Object |
sort |
sort |
Sort input objects |
Group-Object |
group |
uniq -c |
Group objects by property |
Measure-Object |
measure |
wc |
Count lines, words, characters |
Compare-Object |
compare , diff |
diff |
Compare two sets of objects |
Text Processing
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Where-Object |
where , ? |
grep , awk |
Filter objects by condition |
ForEach-Object |
foreach , % |
xargs |
Process each object |
Select-Object |
select |
cut , awk |
Select specific properties |
Tee-Object |
tee |
tee |
Send output to file and pipeline |
Out-String |
N/A | N/A | Convert objects to string |
ConvertFrom-String |
CFS | awk , sed |
Parse structured text |
ConvertTo-Html |
N/A | N/A | Convert objects to HTML |
ConvertTo-Csv |
N/A | N/A | Convert objects to CSV |
ConvertFrom-Csv |
N/A | N/A | Parse CSV data |
ConvertTo-Json |
N/A | jq |
Convert objects to JSON |
ConvertFrom-Json |
N/A | jq |
Parse JSON data |
Process Management
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Get-Process |
gps , ps |
ps |
List running processes |
Stop-Process |
spps , kill |
kill |
Terminate processes |
Start-Process |
saps , start |
nohup , & |
Start new process |
Wait-Process |
N/A | wait |
Wait for process to complete |
Debug-Process |
N/A | gdb , strace |
Debug a process |
System Information
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Get-Date |
N/A | date |
Get current date/time |
Get-Host |
N/A | hostname , uname |
Get host information |
Get-ComputerInfo |
N/A | uname -a , hostinfo |
Get computer information |
Get-Service |
gsv |
systemctl , service |
List system services |
Start-Service |
sasv |
systemctl start |
Start a service |
Stop-Service |
spsv |
systemctl stop |
Stop a service |
Restart-Service |
N/A | systemctl restart |
Restart a service |
Get-EventLog |
N/A | tail /var/log/* |
Read event logs |
Get-WmiObject |
gwmi |
Various (df , free , etc.) |
Get WMI/system information |
Get-CimInstance |
gcim |
Various system commands | Get CIM instances |
Network Operations
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Test-Connection |
N/A | ping |
Test network connectivity |
Invoke-WebRequest |
iwr , curl , wget |
curl , wget |
Make HTTP requests |
Invoke-RestMethod |
irm |
curl (with JSON parsing) |
Make REST API calls |
Test-NetConnection |
N/A | telnet , nc |
Test network connection |
Get-NetAdapter |
N/A | ifconfig , ip addr |
List network adapters |
Get-NetIPAddress |
N/A | ifconfig , ip addr |
Get IP addresses |
Get-NetRoute |
N/A | route , ip route |
Get routing table |
Resolve-DnsName |
N/A | nslookup , dig |
DNS resolution |
Archive Operations
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Compress-Archive |
N/A | tar , zip , gzip |
Create compressed archives |
Expand-Archive |
N/A | tar , unzip , gunzip |
Extract compressed archives |
Variable and Environment
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Get-Variable |
gv |
set , env |
List variables |
Set-Variable |
sv , set |
export , = |
Set variable value |
Remove-Variable |
rv |
unset |
Remove variable |
Get-ChildItem Env: |
dir env: , ls env: |
env , printenv |
List environment variables |
Clear-Variable |
clv |
unset |
Clear variable value |
New-Variable |
nv |
export |
Create new variable |
Output and Formatting
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Write-Output |
echo , write |
echo |
Output text to console |
Write-Host |
N/A | echo |
Write directly to console |
Write-Error |
N/A | echo ... >&2 |
Write error message |
Write-Warning |
N/A | echo ... >&2 |
Write warning message |
Write-Verbose |
N/A | echo (with -v flag) |
Write verbose message |
Write-Debug |
N/A | echo (with debug flag) |
Write debug message |
Format-Table |
ft |
column -t |
Format output as table |
Format-List |
fl |
N/A | Format output as list |
Format-Wide |
fw |
ls -x |
Format output in columns |
Out-GridView |
ogv |
N/A | Display in grid view |
Out-Printer |
lp |
lpr |
Send output to printer |
Out-Null |
N/A | > /dev/null |
Discard output |
History and Aliases
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Get-History |
ghy , h , history |
history |
Show command history |
Invoke-History |
ihy , r |
!n |
Invoke command from history |
Clear-History |
clhy |
history -c |
Clear command history |
Add-History |
N/A | N/A | Add command to history |
Get-Alias |
gal |
alias |
List aliases |
Set-Alias |
sal |
alias |
Create alias |
Remove-Alias |
N/A | unalias |
Remove alias |
New-Alias |
nal |
alias |
Create new alias |
Execution and Control
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Invoke-Expression |
iex |
eval |
Execute string as command |
Invoke-Command |
icm |
ssh |
Execute command remotely |
Start-Job |
N/A | & , nohup |
Start background job |
Get-Job |
gjb |
jobs |
List background jobs |
Stop-Job |
spjb |
kill |
Stop background job |
Wait-Job |
wjb |
wait |
Wait for job completion |
Receive-Job |
rcjb |
fg |
Get job output |
Remove-Job |
rjb |
N/A | Remove completed job |
Start-Sleep |
sleep |
sleep |
Pause execution |
Module Management
PowerShell Cmdlet | Aliases | Unix Equivalent | Description |
---|---|---|---|
Get-Module |
gmo |
lsmod |
List loaded modules |
Import-Module |
ipmo |
modprobe |
Load module |
Remove-Module |
rmo |
rmmod |
Unload module |
Get-Command |
gcm |
which , command -v |
Find commands |
Get-Help |
help , man |
man |
Get help for commands |
Update-Help |
N/A | mandb |
Update help system |
Common Shortcut Aliases
Alias | Full Cmdlet | Unix Equivalent |
---|---|---|
cat |
Get-Content |
cat |
cd |
Set-Location |
cd |
chdir |
Set-Location |
cd |
clear |
Clear-Host |
clear |
cls |
Clear-Host |
clear |
copy |
Copy-Item |
cp |
cp |
Copy-Item |
cp |
curl |
Invoke-WebRequest |
curl |
diff |
Compare-Object |
diff |
dir |
Get-ChildItem |
ls |
echo |
Write-Output |
echo |
erase |
Remove-Item |
rm |
fc |
Format-Custom |
N/A |
fl |
Format-List |
N/A |
foreach |
ForEach-Object |
N/A |
ft |
Format-Table |
N/A |
fw |
Format-Wide |
N/A |
gci |
Get-ChildItem |
ls |
gcm |
Get-Command |
which |
gm |
Get-Member |
N/A |
gps |
Get-Process |
ps |
group |
Group-Object |
uniq -c |
gsv |
Get-Service |
systemctl |
gv |
Get-Variable |
set |
iex |
Invoke-Expression |
eval |
ihy |
Invoke-History |
!n |
ii |
Invoke-Item |
open |
iwr |
Invoke-WebRequest |
curl |
kill |
Stop-Process |
kill |
lp |
Out-Printer |
lpr |
ls |
Get-ChildItem |
ls |
man |
Get-Help |
man |
md |
mkdir |
mkdir |
measure |
Measure-Object |
wc |
mi |
Move-Item |
mv |
mount |
New-PSDrive |
mount |
move |
Move-Item |
mv |
mp |
Move-ItemProperty |
N/A |
mv |
Move-Item |
mv |
nal |
New-Alias |
alias |
ndr |
New-PSDrive |
mount |
ni |
New-Item |
touch |
nv |
New-Variable |
export |
ogv |
Out-GridView |
N/A |
popd |
Pop-Location |
popd |
ps |
Get-Process |
ps |
pushd |
Push-Location |
pushd |
pwd |
Get-Location |
pwd |
r |
Invoke-History |
!n |
rd |
Remove-Item |
rmdir |
rdr |
Remove-PSDrive |
umount |
ren |
Rename-Item |
mv |
ri |
Remove-Item |
rm |
rm |
Remove-Item |
rm |
rmdir |
Remove-Item |
rmdir |
rni |
Rename-Item |
mv |
rvpa |
Resolve-Path |
realpath |
sal |
Set-Alias |
alias |
saps |
Start-Process |
nohup |
sasv |
Start-Service |
systemctl start |
sc |
Set-Content |
> |
select |
Select-Object |
cut |
set |
Set-Variable |
export |
sl |
Set-Location |
cd |
sleep |
Start-Sleep |
sleep |
sort |
Sort-Object |
sort |
sp |
Set-ItemProperty |
N/A |
spps |
Stop-Process |
kill |
spsv |
Stop-Service |
systemctl stop |
start |
Start-Process |
nohup |
sv |
Set-Variable |
export |
tee |
Tee-Object |
tee |
type |
Get-Content |
cat |
wget |
Invoke-WebRequest |
wget |
where |
Where-Object |
grep |
wjb |
Wait-Job |
wait |
write |
Write-Output |
echo |
% |
ForEach-Object |
N/A |
? |
Where-Object |
grep |
Notes
- Many PowerShell cmdlets have multiple aliases for compatibility with different shell backgrounds
- PowerShell aliases like
ls
,cat
,ps
make Unix users feel at home - Some PowerShell cmdlets have no direct Unix equivalent because they work with objects rather than text
- PowerShell's object-based nature means some operations are more powerful than their Unix counterparts
- Use
Get-Alias
to see all available aliases in your PowerShell session - Use
Get-Command
to find cmdlets by name pattern or functionality
Last updated: 2025-08-26 20:00 UTC