What is a Shell ?

A Shell is an interface that acts between you and your Linux System. It take commands entered by the user and tell the system to do what ever the tasks those commands specify.

What shell does
What shell does

There are different kind of shells.

  • Bash Shell
  • Ksh shell
  • Tcsh/Csh Shell
  • Z Shell (Zsh)
  • Korn Shell
  • Bourne Shell
  • And may more…

What is Zsh or Z Shell ?

Zsh is a Unix shell which is derived from Bourne Shell. Zsh has plenty of new features including Spelling correction and approximate completion, recursive path expansion, automatic cd etc…

Plugin and theme support gives us the power to customize our shell. This is the coolest feature of ZSH.

Installing Zsh

Before installing Zsh there are few pre-requisites that you need to have installed in your computer. Please make sure that the following tools are installed in your computer.

  • git
  • curl
  • wget

If not install them using the following command.

sudo apt-get install wget curl git
  • First of all let’s check which shell is already installed in your computer. To check that run one of the following two commands in your terminal. (By default ubuntu comes with bash shell)
echo $0
echo $SHELL
By default ubuntu comes with bash shell
By default ubuntu comes with bash shell
  • Install Zsh using the following command.
sudo apt install zsh
sudo apt install zsh
sudo apt install zsh
  • Once the installation is done, you can verify the installed Zsh version using the following command.
zsh --version
zsh --version
zsh –version

Now, inorder to make Zsh as your default shell follow the below steps.

  • Find out the path of the Zsh shell using the following command.
whereis zsh
Zsh shell path
Zsh shell path
  • Now set Zsh as the default shell for the user you are logged in as using the following command.
 sudo usermod -s /usr/bin/zsh $(whoami)
Setting Zsh as the default shell
Setting Zsh as the default shell
  • As the final step Logout and login to your account in order to use Zsh as your new default shell. Once you logged in and open your terminal you will be prompted to set your Zsh startup files as in the following screenshot. Choose option 2  to populate your ~/.zshrc with the default configuration settings.
Zsh startup file setup
Zsh startup file setup
  • Now you can verify that Zsh is actually your default shell using the same commands used in first step.
Zsh as your default Shell
Zsh as your default Shell

Now you have Zsh as your default shell. Thank you for reading.

Also Read: Best Linux Distributions 2019


Leave a Reply

Your email address will not be published. Required fields are marked *