Customize ZSH on Ubuntu Server

How-to

Featured image

1. Prerequisites

2. Install ZSH

Run this command in Terminal

apt-get update && apt-get install zsh -y
zsh --version

3. Set ZSH as default shell

Run this command in Terminal

chsh -s $(which zsh)

4. Install Oh-My-Zsh

Run this command in Terminal

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

5. Customize Oh-My-Zsh

Multiple themes are installed by default here:

ls ~/.oh-my-zsh/themes/

Run this command in Terminal to add fonts

apt-get install fonts-powerline -y

Customize the prompt by adding this code to ~/.zshrc

PROMPT='%{$fg_bold[blue]%}%m%{$fg_bold[red]%}|%{$fg_bold[cyan]%}%1~%{$reset_color%}%{$fg_bold[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg_bold[cyan]%}⇒%{$reset_color%} '

For more info: https://github.com/ohmyzsh/ohmyzsh/wiki/Themes