Bash scripting and Power Shell in Microsoft Operating Systems

Bash and PowerShell are two popular command-line shells that are used on Unix-like and Windows systems, respectively. While Bash and PowerShell have some similarities, they also have some differences in terms of the commands and syntax they support. Here is a table of some common Bash commands and their PowerShell equivalents:

Bash command PowerShell equivalent
alias Set-Alias
cd Set-Location
echo Write-Output
find Get-ChildItem
grep Select-String
ls Get-ChildItem
man Get-Help
mkdir New-Item
mv Move-Item
rm Remove-Item
sed Foreach-Object
sort Sort-Object
tail Get-Content -Tail
tee Out-File or Tee-Object
wc Measure-Object
while While

Please note that this is just a small sample of the commands available in Bash and PowerShell, and there may be additional commands and options available in each shell.

License

Developers ultimate guide: Linux Bash scripting Copyright © 2022 by Matin Maleki. All Rights Reserved.

Share This Book