先安装zsh

yum -y install zsh

# 查看是否安装完成
cat /etc/shells 
/bin/sh
/bin/bash
/sbin/nologin
/bin/dash
/bin/tcsh
/bin/csh
/bin/zsh

# 替换默认的 /bin/bash
chsh -s /bin/zsh
Changing shell for root.
Shell not changed.

# 重启一下
reboot
# 查看现在的shell
echo $SHELL                                                             
/bin/zsh

安装oh-my-zsh

手动安装

# 安装git
yum -y install git

#克隆oh-my-zsh
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh

#复制zshrc
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

自动安装

curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh

不管使用手动或者自动安装,完成后都需要重启。oh-my-zsh才能生效。

修改主题

挑选你喜欢的主题:https://github.com/robbyrussell/oh-my-zsh/wiki/Themes

vim ~/.zshrc
ZSH_THEME=bira

posted on 2020-04-04 13:36  Mysticbinary  阅读(413)  评论(0编辑  收藏  举报