📜  Zsh vs Bash

📅  最后修改于: 2020-12-29 10:31:06             🧑  作者: Mango

Zsh与重击

Zsh外壳是最受欢迎的外壳之一。也称为“ Z壳”。尽管bash shell和Zsh shell都被称为功能强大的shell,但它们也根据用户的喜好有要求。

由于这两个外壳程序都在积极开发中,因此在这里过分具体是不明智的。 Zsh和Bash之间的一些重要区别如下:

Zsh Bash
Zsh provides advanced tab-completion features which are much faster and smarter (supports case insensitive completion with smart defaults). Bash lacks some completion features comparatively to Zsh and is not as fast as Zsh.
Zsh is not installed by default in most of the Linux/UNIX machines. Bash is a built-in shell in most of the Linux/UNIX machines, which makes it portable across different systems.
Zsh supports recursive path expansion. It means if there is only one path (let’s assume: /usr/local/bin), then we can type “cd /u/l/b” and press the tab button to access that path. Bash does not provide support for recursive path expansion. However, there are some alternative ways like using vim or command completion (compgen -c).
Zsh has built-in spelling correction and approximate completion feature for the typing mistakes in directory names or command names. Bash does not support spelling correction and completion features by default.
Zsh provides supports for several plugin frameworks and themes. Bash has limited support for the plugin frameworks and themes.
In Zsh, ‘which command’ will reveal the definition of an alias, the source for a function, and the location of a command. In Bash, ‘which command’ only reveals the location of a command.

这就是我们可以区分Zsh和Bash的方式。