Skip to content

Configuring Oh My Zsh on CentOS

Checking the Current Shell

echo $SHELL

In most cases, this will return bin/bash.

Installing Zsh

yum install -y zsh

Changing the Default Shell to Zsh

You need to run this command as the root user:

chsh -s /bin/zsh

Installing Git

yum install -y git

Installing Oh My Zsh

Automated Installation

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
or
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Manual Installation

If you cannot install using the methods above (possibly due to restrictions), you can manually install Oh My Zsh with the following steps:

Download the source code:

git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh

Copy the configuration:

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

Changing the Oh My Zsh Theme

List all available themes:

ls ~/.oh-my-zsh/themes

Modify the theme:

vim ~/.zshrc

Change the default theme, which is `ZSH_THEME="robbyrussell," to your preferred one.

Reboot to Apply Changes

reboot

References and Acknowledgments

Original: https://wiki-power.com/ This post is protected by CC BY-NC-SA 4.0 agreement, should be reproduced with attribution.

This post is translated using ChatGPT, please feedback if any omissions.