How to install the zsh shell in Linux; how to set it as a default login shell

Z shell’s (zsh) popularity has increased in the last years. I have not moved too zsh yet, but I am going to do that.

zsh is not installed in Linux by default, but it can be installed easilly with a package manager:

1. Check if zsh is already installed on your Linux:

$ < /etc/shells grep zsh
/bin/zsh
/usr/bin/zsh

If you get an output (like I got), it means zsh already exists on your OS. If not, feel free to install it.

2. Download and install the Z shell:

For Debian based distros: $ sudo apt-get install zsh

For Red Hat based distros: $ sudo yum install zsh

For Suse based distros: $ sudo zypper install zsh

To simple use zsh, type zsh in your terminal:
$ zsh

3. How to set zsh as the default login shell:

This works on Fedora / Debian / OpenSuse: chsh -s /bin/zsh user

$ sudo chsh -s /bin/zsh yoda
$ finger yoda | grep zsh
Directory: /home/yoda Shell: /bin/zsh

If you want to customize the Z-shell, edit ~/.zshrc: vim ~/.zshrc

 

Share and Enjoy

  • Twitter
  • Facebook
  • Google Plus
  • Email
  • RSS
Tagged with: , , , , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

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

*

Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!