改源
-
備份你的原鏡像文件,以免出錯后可以恢復(fù)。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup -
下載新的CentOS-Base.repo 到/etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo [<http://mirrors.aliyun.com/repo/Centos-6.repo>](<http://mirrors.aliyun.com/repo/Centos-6.repo>)-
如果沒有安裝wget,可以運行下面命令,安裝wget
yum -y install wget -
如果你的系統(tǒng)是其他版本可以查看http://mirrors.aliyun.com/repo/
wget -O /etc/yum.repos.d/CentOS-Base.repo [<http://mirrors.aliyun.com/repo/Centos-8.repo>](<http://mirrors.aliyun.com/repo/Centos-5.repo>)
-
-
運行yum makecache生成緩存
yum makecache
安裝zsh
-
安裝
yum install -y zsh -
驗證
cat /etc/shells -
切換默認(rèn)
shell為zsh. Changing shell for 當(dāng)前用戶.chsh -s /bin/zsh- 關(guān)閉當(dāng)前終端,重新連接。
- 重新連接后可能遇到這種問題。xjb選選吧,或者直接選1。

image.png

image.png

image.png
-
驗證
echo $SHELL -
安裝oh-my-zsh
-
安裝git
sudo yum install git -
安裝oh-my-zsh
wget [<https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh>](<https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh>) -O - | sh -
查看主題
ls ~/.oh-my-zsh/themes
-
-
安裝插件
插件安裝在
~/.oh-my-zsh/plugins/incr目錄(沒有則新建),安裝下面插件時,需要先cd到這一級目錄。-
自動提示插件
incr-0.2.zshwget <http://mimosa-pudica.net/src/incr-0.2.zsh> echo 'source ~/.oh-my-zsh/plugins/incr/incr*.zsh' >> ~/.zshrc source ~/.zshrc
-
-
設(shè)置命令簡寫
例子:把
clear命令可以簡寫成c具體操作步驟如下
vim ~/.zshrc隨便找地方加入這條命令
alias c = "clear"

image.png
- 執(zhí)行命令
source ~/.zshrc