Bash is the grandfather, and it powers tons of Linux distributions as the default shell. If you have ever used a terminal session, chances are you have come across Bash.
This complete article will break down the features of two close competitors: ZSH and Fish. By the end of this article, you should know what are the similarities and differences of these shells.
What is ZSH?
Z shell, commonly called ZSH, is a Unix shell utility, command interpreter, and scripting language built on top of Bash. It extends Bash features and adds new ones, including the ability to add plugins and themes. One of the outstanding features of ZSH is being customizable.
Since ZSH is built on Bash, it provides similar functionality and scripting features, including functions, loops, conditionals, and more.
What is Fish?
Fish is a Linux and macOS shell, command interpreter, and shell scripting language. Fish defines itself as a free, open-source shell utility that is incredibly easy to learn and use. It provides “sane” scripting language features, making it genuinely beginner-friendly.
Differences between Fish and ZSH
Let us now take a look at some of the differences between these Unix shells:
|Follows and supports the Posix standard.||It does not follow the Posix standard.|
|ZSH supports both the use of aliases and functions.||Fish does not allow the use of aliases but uses functions to manage the use of aliases.|
|Installation and usage of ZSH are not very straightforward. Additionally, one needs to understand the basics of Bash scripting before scripting with ZSH.||On the other hand, Fish is classified as an easy-to-use shell both for beginners and experienced developers.|
|ZSH does not offer auto-suggestions and syntax highlighting out of the box.||In Fish, auto-suggestions and syntax-highlighting are offered out of the box.|
|Compared to Fish, it is not easily portable as it may require various dependencies to run.||Fish is highly portable and can be easily exported as a single package.|
|ZSH documentation is not very well organized compared to Fish.||Fish has excellent documentation with easy-to-follow guides along the way.|
|Its scripting language is based on Bash, which is not very beginner-friendly.||Fish identifies itself as having sane scripting syntax. This means that the syntactical format is different from those offered by Bash and ZSH, offering more clean and readable code.|
|Searching through command history is not as easy compared to Fish.||Fish automatically removes duplicate commands making it easy to search through the history of commands.|
Both Fish and ZSH offer closely similar features. With the addition of plugins and frameworks, such as oh-my-zsh, you can fully customize the ZSH shell in every possible way.
On the other hand, Fish is easy-to-use and configure, requiring minimal to no configuration.
In this guide, we looked at the key differences between ZSH and Fish shells. If you are looking for a Bash complement with additional features, ZSH might be the way to go. If you are looking for a simple, easy-to-set-up and use the Unix shell, Fish might be your best bet.
Thank you for reading!