Hello, friends. Changing the Linux shell is effortless and helps to further customize the system where we work. Today, you will learn how to install Z-Shell on Ubuntu 22.04. This is perhaps the best alternative to bash.
Introduction
ZSH or Z-shell is a powerful command interpreter for Unix-like operating systems, such as BSD or GNU/Linux. It works somewhat like an extended version of Bash because it supports themes, plugins and new features without losing compatibility.
That is why many users, who want to further customize their terminal work environment, end up installing it and configuring it as the main shell.
So, let’s go for it.
Install Z-Shell on Ubuntu 22.04 | Linux Mint 21
Fortunately, Z-Shell is present in the official repositories of the distribution. So, the installation is easy to do.
First, open a terminal and update the whole system completely
sudo apt update
sudo apt upgrade
Then, you can search for information about the zsh
package that contains the application as such.
apt show zsh
And after you get some useful information about the package, you can install it
sudo apt install zsh
The above command should not take long to run since it is lightweight, but once it finishes, you can check the installed version of Z-shell.
zsh --version
zsh 5.8.1 (x86_64-ubuntu-linux-gnu)
Now you just need to use it by running
zsh
And start the configuration process to your heart’s content.
Bonus: Install oh-my-zsh plugin
This plugin takes Z-shell to the next level, so it is suggested that you install it.
To do so, open a terminal and install the necessary packages:
sudo apt install git-core curl fonts-powerline
And then install the plugin as such:
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
With this script, the plugin is automatically downloaded and installed, making it compatible with Z-shell.
If you want to add a plugin to Z-shell just go to this link, check the plugin name and add it to the .zshrc
file
nano ~/.zhrc
And for example, add this line:
plugins=(rails git ruby)
Where the rails, git and ruby plugins will be enabled. But you can add and enable others.
In that same file, you can specify the theme to use:
ZSH_THEME="[theme]"
Save the changes and close the editor.
To apply them, just run
source ~/.zshrc
And you are done.
Conclusion
In this post, you learned how to install Zsh or Z-shell on Ubuntu 22.04 | Linux Mint 21 that helps us to have another shell different and very efficient that gives us more options than bash.