Bash, Zsh and Fish: The awesomeness of Linux Shells

Bash, Zsh and Fish: The awesomeness of  Linux Shells

My wife the other day saw a black screen overlayed with white text on her computer and she freaked out. She instantly thought that there was something wrong with her computer. Of course, I just looked at her with a smiley face.

The terminal is nothing more than a blank page to a writer. It’s very intimidating because it requires you to do something, anything really else it’ll keep starring at you forever.

Originally computers were operated via the command line which made them terribly difficult to use. They were reserved for the nerds because you had to have an idea of what do to with it. Then Graphical User Interfaces(GUIs) arrived thanks to some research from Xerox park and then the rest is history.

But the command-line is still a very powerful tool for advanced users. The Unix/Linux commandline or terminal or shell is the most powerful each appealing to the curious, adventurous and the kool kids. They include; bash, ksh, zsh, tcsh, fish and others. However, I have particularly used bash, zsh and fish shells.


GNU Bash aka the Bourne Again Shell, is the most common Linux shell out there. In fact it comes as the default shell for most Linux distros.

Bash comes pre-installed with tone of powerful features that include
Looping Constructs, Conditional Constructs, Shell Functions, Bourne Shell Builtins, Bourne Shell Variables, Brace Expansion, Tilde Expansion, Aliases to mention just a few. With these you can write cool bash scripts that can help you automate certain functions such as backups, application installations and deployments, text search and editing among other things.

For example here’s a one-line script that demos use of for loop and if statement;

$ for i in $(ls -l *.pdf); do if [ "$i" == "SlSupportPolicy.pdf" ]; then echo "got file $i"; fi; done; 

got file SlSupportPolicy.pdf

Bash is really awesome.


Originating in the early 90s, Zsh is yet another great shell that’s not any different from Bash.

But what makes Zsh too awesome is when you combine it with oh-my-zsh. Oh-my-zsh is community-driven framework for managing zsh configuration. It includes 200+ optional plugins (rails, git, OSX, hub, capistrano, brew, ant, php, python, etc), over 140 themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.

So Zsh+oh-my-zsh framework will give you auto-completion, tab completion, several cool themes, programming language integration and like bash is Posix compliant.


#install zsh
sudo apt-get update
sudo apt-get install zsh

#install oh-my-zsh with auto-suggest, syntax-highlighting plugins

sh -c "$(curl -fsSL"

git clone ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

git clone git:// ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

vi ~/.zshrc 
plugins=(git zsh-syntax-highlighting zsh-autosuggestions)


Fish is simply my favorite shell for the following reasons;

  • Syntax highlighting for commands, comments.
  • Auto suggestion based on your terminal history
  • Auto competition generated by parsing man pages which makes it super smart.
  • Optional Web-based configuration although you can also edit ~/.config/fish/ directly using Vim or any other text editor.
  • And just works out of the box. Not much configuration and tweaking is required.

    The bummer with fish is that it’s not entirely Posix-compliant. So sometimes my one-liner bash commands just brake. For instance && operator doesn’t always work as expected.


sudo apt-get update
sudo apt-get install fish
How to change user’s shell

Changing a user’s shell is very easy. You can either you use chsh command like below which changes dave’s default shell to zsh;
sudo chsh -s /bin/zsh dave
Or you can edit /etc/passwd file and manually edit the user’s shell from there.

Because of several options out there, sometimes it’s hard to make a choice. I would recommend that if you are developer, then you should go with Zsh+oh-my-zsh combo. Sys admin can stick to the good old bash and Devops guys might definitely find fish a plausible alternative. Personally I tend to oscillate between fish and zsh depending on what am doing.

**Quick one folks: For the last 7 months, I have been working on this cool project that automates website uptime monitoring, checks SSL certificate for errors and Expiry, monitors domain expiry and cron jobs. You probably want to keep tabs on these if you are running a website or app in production. So Please Sign up to Site Monki today for free. **



Leave a Reply