How to Install Z Shell(zsh) on Linux?

The ZSH or Z Shell is a Unix based shell or can be called as a command-line interpreter. It is an extended version of the good old Bourne shell (sh). It does have some features form Bash with lots of added features like automatic cd (Change Directory), spell check, path expansion, and many more. It also supports plugins and themes.

Installing ZSH on Ubuntu

Step 1: First, we will have to update the repository by running the following command:

sudo apt-get update

Install-ZSH-on-Ubuntu-1



Step 2: Now we will install the zsh by running the following command:

sudo apt-get install zsh -y

Install-ZSH-on-Ubuntu-2

Step 3: Now we have to make the zsh as our default shell using the following command:

chsh -s /usr/bin/zsh

Note: You will need to enter your password for the user after running the command.

Install-ZSH-on-Ubuntu-3

Step 4: Now that we have set the zsh as our default shell, we have to configure it. So, we will run zsh in the terminal to execute it. This will show the Z shell configuration.

Install-ZSH-on-Ubuntu-4

Step 5: Here you can do what is specified by typing the character given at the start of every line. You can quit, go in the main menu and configure the shell your self or you can go for the recommended configuration for the shell by pressing 2, which is what we have done.

Install-ZSH-on-Ubuntu-5

Step 6: After this, the Z shell is ready to use. But the shell is not changed from bash to zsh.

Step 7: You will have to logout of your system and log back in to see the change. Open terminal and you should see the Z shell started. To check run the following command:

echo $SHELL

Install-ZSH-on-Ubuntu-6

As you can see, it showed /usr/bin/zsh, which means it is successfully set as the default shell.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.