Installing zsh + oh-my-zsh on Amazon EC2 Amazon Linux 2 AMI

邱秋 • 2024年06月24日 • 阅读:24 • linux ec2
sudo yum update

# Installing ZSH
sudo yum -y install zsh

# Check ZSH has been installed
zsh --version

# Install "util-linux-user" because "chsh" is not available by default
# See
sudo yum install util-linux-user

# Change default shell for current user, most of the times it would be "ec2-user"
# Or use "sudo chsh -s $(which zsh) $(whoami)" to be sure
chsh -s "$(which zsh)"

# Install oh-my-zsh from


# I recommend you to install the following plugins which make your life easier and more colorful

# Assuming you have git installed
# If not, simply do "sudo yum install git -y"
git clone ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

# And then add them to "~/.zshrc" file
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Happy time & eyes saving!