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

Veda Swaroop
3 min readOct 9, 2022

Tell me don’t you want to customize 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 customization. So, let’s change the default bash to zsh and customize it.

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

For Ex:

On Debian and its derivatives: sudo apt install zsh git

On Arch: sudo pacman -S zsh git

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

Konsole Terminal: zsh configuration

Type 1 and continue to the main menu and complete the configuration settings 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 the 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 the terminal type the second command as shown above and check your default shell. It will be zsh.

Let’s customize zsh:

#6. zsh customization.

Commands:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/Downloads/powerlevel10kecho 'source ~/Downloads/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc

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

#7. Restart zsh.

Command: exec zsh.

The above command will restart zsh shell.

Once opened, configure the powerlevel10k theme to your liking.

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

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

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

zsh shell can be customized with different themes, plugin integrations with other tools, and more.

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

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

--

--

Veda Swaroop

I love Science, Technology, Linux and Computers in general. A.I, Machine Learning, Deep Learning Enthusiast.