目前的centos系統(tǒng)默認(rèn)的shell還是bash,但是zsh被稱為終極shell,國外有個(gè)程序員開發(fā)出了一個(gè)能夠讓你快速上手的zsh項(xiàng)目,叫做「oh my zsh」,Github 網(wǎng)址是:https://github.com/robbyrussell/oh-my-zsh 有了這玩意zsh用起來直接就變成神器了。
查看系統(tǒng)當(dāng)前的shell
echo $SHELL
返回的結(jié)果是:
/bin/bash
查看bin下是否有zsh包
cat /etc/shells
**********************************************
返回的結(jié)果是:
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
PS.默認(rèn)沒有安裝zsh
zsh
安裝
sudo yum install -y zsh
然后在輸入cat /etc/shells查看
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/zsh
配置
將zsh設(shè)置成默認(rèn)的shell
chsh -s /bin/zsh

設(shè)置完以后不會(huì)立即生效,需要重啟方能生效,所以我們可以配置完oh-my-zsh以后再重啟
oh-my-zsh
安裝
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
如果出現(xiàn)以下界面表示成功
__ __
____ / /_ ____ ___ __ __ ____ _____/ /_
/ __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \
/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / /
\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/
/____/ ....is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us at https://twitter.com/ohmyzsh.
p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.
配置主題
主題鏈接地址 oh-my-zsh主題
目前我使用的主題是bira

image
修改主題
$ vim ~/.zshrc
剛安裝oh-my-zsh默認(rèn)的主題是robbyrussell,將ZSH_THEME改成bira
更新配置
$ source ~/.zshrc
然后重啟, 使zsh配置生效
$ reboot