How to install ZSH on CentOS

How to install ZSH on CentOS

ZSH it is a popular Unix shell, with some features that you maybe will not found in Bash.

These are the step that you need to follow to ZSH install on your CentOS:

  • Make sure that the command chsh is available in your system if you don't have it, the package that contains the command is util-linux-user.
sudo dnf install util-linux-user -y
  • We can install ZSH in the system with this command:
sudo dnf install zsh -y
  • Now that ZSH is installed we need to change the current shell using the command chsh, for example, if the user name of the account that you want to change the shell is tom, you can use this command to change the shell:
sudo chsh -s /bin/zsh tom

If you don't specify a user name, root will be used, you also can be specific with this command:

sudo chsh -s /bin/zsh root

Finally, you need to logout from the current shell session with the command exit and start a new session.