Open In App

How to Install Z Shell(zsh) on Linux?

Improve
Improve
Like Article
Like
Save
Share
Report

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.


Last Updated : 05 Oct, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads