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

 

Ref:

  http://linuxg.net/how-to-install-zsh-shell-how-to-set-it-as-a-default-login-shell/

posted @ 2016-05-14 11:12  drfxiaoliuzi  阅读(451)  评论(0编辑  收藏  举报