This guide explains how to install, use and configure several themes in Zsh.
I bet all true Linux fans love Terminal. A Terminal is a way of executing commands from a user for the Linux Kernel. And a way for Linux Kernel to interact with users as well. Hence, it is always a much faster way of doing several activities via the terminal.
If you are a system administrator managing multiple Linux desktop systems in a local network or organisation network, you spend most of your time in a terminal. If you use a desktop environment for those works, you might want to change the look of your terminal. And it helps to move away from the mundane default terminals of Ubuntu and other Linux systems.
By default, almost all Linux distributions use the Bash shell. The bash shell is a solid program and an old one too. But it lacks specific customisation options. For example, if you want some nice colours, the execution time for commands, etc. – it isn’t easy to customise.
So, for those customisations, you can use the Zsh shell, which is, in a way, an extended Bash Shell with additional improvements.
And in this guide, we explain how to install, use and configure several themes in Zsh. This applies to all Linux distributions.
Table of Contents
Installing Zsh is easy. The following command does the trick.
Ubuntu, Debian, Linux Mint and all related distro
sudo apt install zsh
sudo dnf install zsh
pacman -S zsh
Configure and use zsh
After installation, you need to configure the Zsh and replace your bash shell. To do that, open the terminal and run the below command. Change the username to your system (root in the example below).
- First, find out the executable path of Zsh.
- Then change the Shell using the below command.
chsh -s /usr/bin/zsh root
- Then log off and log in again and open the terminal. You should see a first-time setup screen. Choose 0. This should create an empty .zshrc file.
And now it’s time to colourise Zsh.
Install and Configure Oh My Zsh
Oh My Zsh is a collection of script and themes which gives the actual look and feel of your terminal. It is present on GitHub, which you need to download and install. Follow the steps below.
- If Git is not installed, install it via
sudo apt install gitOr,
sudo dnf install git.
- Then run the following command.
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
Or, you can use any of the below installation methods.
- The above command will install the Oh My Zsh and create a configuration folder in your home named .zshrc.
- Copy the templates.
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
- Recompile the Zsh.
- And you should see a nice-looking terminal prompt.
See the above screen prompt. That is the default prompt. Now, Oh My Zsh is pre-loaded with many themes. They are located in
~/.oh-my-zsh/themes. See below.
How they look, you can find it here. It’s a good idea to browse through first before making a change.
Now, to change a theme, note down the name from above and update it in the ~/.zshrc file via any text editor. For this tutorial, I will change to
In the file, change the name of the ZSH_THEME property with the theme name. Save and close the file.
Recompile the .zshrc file.
Close and open the terminal again. And you should see the new theme in action.
I hope this guide helps you to transform your otherwise mundane terminal. You can play around with various themes and settle on what you like. You can also learn more about configuration options on the official GitHub page or Arch Wiki.
Let me know whether you can change your terminal. Also, share your terminal screenshot in the comment box below. Cheers.