centos7 安裝zsh和oh-my-zsh

目前的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
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容