How to customize and enhance the appearance of your terminal in Ubuntu 22.04 and 20.04 or Linux. If you find yourself too accustomed to the default terminal theme or simply bored with it, this guide offers a great solution.
How to customize terminal in Ubuntu or Linux with Powerline & ZSH
Powerline is a text-based tool that provides useful information in a variety of contexts and enhances the appearance of your terminal, serving as a status line plugin for vim and providing status lines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome, i3, Qtile, and customize terminal Ubuntu or Linux.
Method 1: Customize terminal Ubuntu Or Linux with Powerline
Step 1. Install Powerline for Customize Linux Terminal
The following demo shows Powerline displaying information about a Git repository, After customization, your terminal should look like this:
~ ▶ mkdir myrepo itsmeit ▶ ~ ▶ cd myrepo itsmeit ▶ ~ 〉 myrepo ▶ git init Initialized empty Git repository in /home/itsmeit/myrepo/.git/ itsmeit ▶ ⎇ master ▶ ~ 〉 myrepo ▶ touch myfile itsmeit ▶ ⎇ master ▶ ~ 〉 myrepo ▶ git add myfile itsmeit ▶ ⎇ master ▶ ~ 〉 myrepo ▶
To customize terminal ubuntu 22.04, 20.04, let’s get started to add the repository and install Powerline for Ubuntu Universe repository with the following command:
sudo add-apt-repository universe sudo apt install powerline -y
Next, To config Powerline for bash shell, add the following lines at the bottom of your “$HOME/.bashrc” file:
sudo nano ~/.bashrc
# Powerline configuration if [ -f /usr/share/powerline/bindings/bash/powerline.sh ]; then powerline-daemon -q POWERLINE_BASH_CONTINUATION=1 POWERLINE_BASH_SELECT=1 source /usr/share/powerline/bindings/bash/powerline.sh fi
Save the file and run the command below to apply the changes to the saved config:
Step 2. Install and configure Powerline font.
To continue, you need to create a directory named “.font” located in /home/$USER. The “.font” folder will contain a custom font with Powerline for your terminal. The command below will create a .font directory inside /home/$USER.
mkdir -p ~/.fonts
Next, download the font for Powerline with wget to customize terminal Ubuntu 20.04, 20.04, or Linux
wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline.ttf -O ~/.fonts/Liberation\ Mono\ Powerline.ttf wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Bold.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Bold.ttf wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Italic.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Italic.ttf wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Bold%20Italic.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Bold\ Italic.ttf
Finally, apply newly installed fonts, and Close reOpen terminal, you will see the difference.
fc-cache -vf ~/.fonts
Method 2: Customize terminal Linux or Ubuntu 22.04 with Oh My Zsh
Oh My Zsh is an open source for ZSH config management and is community driven. It comes with a lot of useful function, plugins, helper, themes, and a few things that will help you to use the terminal better. There are more than 275 plugins and 150 themes supported now. And here is the 2nd way to customize terminal Ubuntu 22.04 | 20.04 & Linux
Step 1. How to install Oh My Zsh on Ubuntu and Linux
Install either curl, wget, or git if your device does not have it. Then, copy and run the commands in sequence on the terminal.
sudo apt install curl sudo apt install zsh sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
After the installation Oh My Zsh is done, it will automatically select the default display ZSH. You can use the following command to check the current defaults:
In case ZSH is not already defaulting, run the following command to set it as default:
chsh -s $(which zsh)
usermod -s $(which zsh) [username]
After you Install Oh My Zsh to customize terminal Ubuntu 20.04 | 20.04 & Linux, it will make a backup copy of your existing .zhrc file. Then a new .zshrc file will be created with the config. So whenever you decide to remove Oh My Zsh with the uninstaller, an old .zshrc file will automatically be reverted.
Out of all the features in OH-MY-ZSH, I like the set of theme that come with the installation. It visually improves my terminal interface. Theme are install in
Note: Change the itsmeit to the username you are using, On the terminal, type
whoami to get the username.
Step 2. How to config Oh My Zsh Linux terminal theme
The default theme when install Oh My Zsh will be “robbyrussell“. To change the theme, modify the ZSH_THEME =”theme-name” parameter in the .zshrc file. You can test theme name on this parameter and save, Example below.
Run the command below to edit the file
sudo nano ~/.zshrc
And you need to run the command source ~/.zshrc for the change to take effect.
Step 3. Install OH-MY-ZSH Plugins for customize Linux terminal
Oh My Zsh comes bundled with plugins, which allow you to take advantage of the functionality of many sorts in your shell just by enabling them. They are each documented in the README file in their respective
There are many plugins that support beauty, customize terminal ubuntu 22.04 | 20.04 & Linux powered by Oh My Zsh. Setting up and configuring the plugin is also quite easy. All you have to do is run the commands below and add its name in the plugin parameter of the .zshrc file.
2 plugins that support character suggestions, keywords, highlights, and syntax… are below so you can install them and configure them for the terminal. Come on, download it now
- Autosuggesions plugin
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
- Zsh-autocomplete plugin
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete
And after downloading the above plugins, edit the .zhsrc file, add the plugin name (plugins=(git)) and replace it:
sudo nano ~/.zshrc
plugins=(git zsh-autosuggestions zsh-autocomplete)
Run the command source ~/.zshrc for the change to take effect
How to remove OH-MY-ZSH on Ubuntu | Linux
To uninstall Oh My Zsh and restore the previous linux customize terminal configuration, execute the command “uninstall_oh_my_zsh”. This will delete all files and directories related to Oh My Zsh. Please log out and log back in to switch to the default bash shell
The above two methods provide a way to customize terminal Linux or Ubuntu 22.04, 20.04 using Powerline and Oh My Zsh. There are many exciting features to explore, if you have any questions, please leave a comment.