在Linux虚拟机使用shell的时候,发现默认的不太好用,接下来使用oh-my-zsh来替换默认的shell。
安装zsh
输入cat /etc/shells
命令来查看本地安装的shell

发现并没有zsh,我们使用yum来安装它
输入yum -y install zsh
,等待下载完成

再次输入cat /etc/shells
,发现zsh已经安装好

替换默认shell
chsh -s /bin/zsh
切换sehll至zsh

reboot
重启后,查看当前使用的shell,已经改成了zsh
echo $SHELL

安装oh-my-zsh
手动安装
1-1、安装git
yum -y install git
1-2、克隆oh-my-zsh
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
1-3、复制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就生效了。
主题设置
修改.zshrc中的 ZSH_THEME
字段

可以从主题中选择自己喜欢的主题,完成后,重启就生效了。
网友评论