📜  PowerShell vs Bash Shell

📅  最后修改于: 2021-01-08 01:54:16             🧑  作者: Mango

PowerShell与Bash Shell

PowerShell和Bash Shell都使用它们自己的配置管理工具来提供一个智能命令行界面(CLI)。

PowerShell与Bash相似。通常,bash中使用的命令可以在PowerShell中使用,例如“ rm”,“ ls”,“ cp”。

这两个外壳程序都包含用于管理文件,导航目录和启动其他程序的命令。

什么是Bash Shell?

Bash Shell是由Brian Fox编写,由GNU项目开发的Unix Shell和命令行语言。它于1989年首次发布。它的版本也可用于Windows 10操作系统和solaris 11中的默认用户外壳程序。它还可以在任何版本的UNIX操作系统上运行

什么是PowerShell?

Windows PowerShell是Microsoft创建的自动命令行外壳程序和相关脚本语言。它是专为系统管理员设计的,使他们能够通过完全访问COM和WMI在远程和本地Windows系统上执行任务。

它于2006年以其第一个版本PowerShell 1.0引入。

PowerShell与Bash Shell比较表

PowerShell Bash Shell
1. PowerShell is a command shell and associated scripting language for the majority of windows operating system. 2. Bash is the command shell and scripting language for the majority of the Linux operating system.
2. PowerShell was introduced in 2006 with its first version. 2. Bash shell was introduced in 1989.
3. It treats input and output as an object. 3. It always accepts input and output as a text structure.
4. The user interface of PowerShell is a graphical command-line interface CLI. 4. The user interface of Bash shell is a text-based command-line interface.
5. It can execute on any version of Windows from Window 97 to Windows 10. 5. It is mainly prepared for Linux and Unix operating system from the first day

Bash与PowerShell命令的比较

Description Bash PowerShell
List files and folders ls Ls, Get-childItem
Change directory cd Set-childItem
Show Working directory pwd Get-Location
Clear the Screen Clear cls, clear
To copy a file cp Copy-Item
To remove or delete a file rm Remove-Item, ri, rmdir, rd, del, rm
To print a string echo “string” Write-host “string” OR
echo “string”
To create a New text file touch New-Item