How to change the default bash shell to zsh on Linux.

Tell me don’t you want to customise your terminal and make it look cool like this…?

KDE Konsole zsh terminal shell

By default, your Linux distribution might package the bash terminal shell. It is good, but zsh is better with a lot of scope for customisation. So let’s change the default bash to zsh and customise it.

First of all, install zsh, git on your machine.

For Ex:

On Debian and it’s derivatives : sudo apt install zsh git

On Arch : sudo pacman -S zsh git

Once installed, type zsh in terminal and complete the configuration. Which looks as shown below.

Konsole Terminal: zsh configuration

Type 1 and continue to main menu and complete the configuration settings which looks as shown below.

Konsole Terminal: zsh main menu configuration.

Select and configure the recommended settings above. Upon completion, a hidden .zshrc file will be created in your home directory.

Now type the following commands in terminal.

# 1. The following command displays all available shells on your machine.

Command : cat /etc/shells

Output : /bin/zsh and /usr/bin/zsh

# 2. This command displays your current shell.

Command : echo $SHELL

Output : /bin/bash, if bash was the default shell.

# 3. The following command displays the path for zsh.

Command : which zsh.

Output : usr/bin/zsh.

# 4. Change the default bash shell to zsh.

Command : chsh -s /usr/bin/zsh <user name>

Output: Enter your password to change the default shell.

Note: After that, Reboot your machine.

After reboot, open terminal and type the second command as shown above and check your default shell. It will be zsh.

Let’s customise zsh:

#6. zsh customisation.

Commands:

Output: Above commands will download the powerlevel10k theme to Downloads folder and copy it to .zshrc file.

#7. Restart zsh.

Command: exec zsh.

Above command will restart zsh shell.

Once opened, configure powerlevel10k theme to your liking.

If you don’t see any zsh theme configuration, type p10k configure in terminal and complete the theme configuration.

The theme configuration is very easy. You will be given choice on how do you want your zsh shell to look like. Select the choice of your liking and complete the theme configuration. Finally, your terminal zsh shell will look just like the first picture shown above.

This is just a simple customisation for zsh. We used, powerlevel10k theme. Please check their GitHub link to find out more.

zsh shell can be customised with different themes, plugin integrations with other tools and so much more.

Please check, oh my zsh website to find out how much you can customise zsh and make it look so cool.

If you find yourself reading till here. Thank you for reading this article on zsh.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Veda Swaroop

I am Post Grad. Electrical Engineering graduate. I love Science, Technology, Linux and Computers in general. Machine Learning, Deep Learning Enthusiast.