How to install ZSH on Kali Linux

With the release of Kali Linux 2020.3, the Kali team is making the move from Bash (Bourne Again Shell) to ZSH (Z-Shell).

ZSH has several advantages over Bash. These include:

  • Powerful context based tab completion.
  • Pattern matching/globbing on alien steroids.
  • Themeable prompts.
  • Loadable modules.
  • Good spelling correction.
  • Sharing of command history among all running shells (I like my command line history and all my Konsole tabs)
  • Global aliases.

ZSH is already installed as part of Kali Linux 2020.3. If you are running an earlier version, it can be installed by doing the following:

First run the following command to install zsh:

sudo apt-get install -y zsh zsh-syntax-highlighting zsh-autosuggestions

Second, run the following command to create a default zsh configuration:

cp /etc/skel/.zshrc ~/

Then just run the command zsh to change to the zsh shell.

If you want to move to zsh permanently, run the following command which will open zsh any time you go to the terminal:

chsh -s /bin/zsh

The following shows what your zsh should look like (The image comes from the Kali website)

Some things you may notice after installing zsh are:

  • Coloured commands:
    • ip
    • diff
    • grep/egrep/fgrep
  • Coloured man pages
  • The Bash prompt is now blue for the regular users

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s