统信UOS安装zsh并使用oh-my-zsh美化终端
本文介绍了在统信UOS系统上安装和配置zsh的步骤,包括给root用户和普通用户安装oh-my-zsh,以及重启系统后查看效果。
注意:此操作之前请先安装 git。参考我的文章:统信UOS基本开发环境搭建之git
# 安装 zsh
sudo apt install zsh
1
# 给 root 用户安装 oh-my-zsh
由于我们一般是次之前先设置 root 密码
sudo passwd root
1
接着切换到 root 用户
su -
1
我们可以检测是否切换成功
root@terwer:/home/terwer/app# whoami
root
1
2
2
然后给 root 安装 oh-my-zsh
git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh \
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
&& git clone https://gitee.com/playerfs/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
&& git clone https://gitee.com/playerfs/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
&& sed -i 's/^plugins=(/plugins=(zsh-autosuggestions zsh-syntax-highlighting /' ~/.zshrc \
&& chsh -s /bin/zsh
1
2
3
4
5
6
2
3
4
5
6
# 普通用户安装 oh-my-zsh
安装之前,切换到普通用户
su - terwer
1
然后,给普通用户安装 on-my-zsh
git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh \
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
&& git clone https://gitee.com/playerfs/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
&& git clone https://gitee.com/playerfs/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
&& sed -i 's/^plugins=(/plugins=(zsh-autosuggestions zsh-syntax-highlighting /' ~/.zshrc \
&& chsh -s /bin/zsh
1
2
3
4
5
6
2
3
4
5
6
# 重启
修改完成记得重启,重启之后,再打开终端,应该就能用 zsh 了。
reboot
1
# 效果
编辑 (opens new window)
上次更新: 2024/06/13, 11:40:40