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…?
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.
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.
Type 1 and continue to main menu and complete the configuration settings which looks as shown below.
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.
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/Downloads/powerlevel10kecho 'source ~/Downloads/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
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.
GitHub - romkatv/powerlevel10k: A Zsh theme
Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience. Install the…
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.
Oh My Zsh - a delightful & open source framework for Zsh
Oh My Zsh is an open source, community-driven framework for managing your Zsh configuration. Sounds boring. Let's try…
If you find yourself reading till here. Thank you for reading this article on zsh.