8.6 C
Texas

Switch to ZSH on Linux

If you’re a Linux user, since the very beginning, you’re familiar with the terminal. It’s the ultimate tool that can perform almost any task. Advanced users are very much fond of this tool. Terminal uses Bash shell by default. It’s enough for average users but lacks a few features. Bash isn’t a modern shell anymore. A good and popular alternative is the Z shell, aka ZSH. It features major improvements above Bash.

Let’s switch from Bash to ZSH.

Installing ZSH

ZSH is one of the most popular alternatives to the Bash shell. That’s why it’s available in almost all the Linux distro repositories. You shouldn’t have any problem getting it into your system. Run the following command(s) according to your system.

  • Ubuntu
sudo apt install zsh -y
- Advertisement -

  • Debian
sudo apt-get install zsh -y
  • Fedora
sudo dnf install zsh
  • OpenSUSE
sudo zypper install zsh
  • Arch Linux

Arch Linux uses ZSH by default. However, run the program for making sure that it does, in case you switched to Bash.

sudo pacman -S zsh
  • Other Linux distros

For other distros, you have to have “ncurses-devel” and “g++” installed in your system. Find those out for your Linux distro and install those.

Then, download the latest ZSH archive from SourceForge.

Now, run the following commands:

# Running all the commands as sudo
sudo -s

cd ~/Downloads
tar -vxzf zsh-5.5.1.tar.gz
cd zsh-5.5.1

./configure
make
make check
make install

Configuring ZSH

Now, let’s start configuring ZSH. At first, run the program from the terminal to open up the configuration wizard.

zsh

From the opened up window, press 1.

 

There are more options to choose from. As we’re configuring the shell completely new, hit 1 again.

From here, press 1 for setting the line-size of history, press 2 for creating the new history file and press 3 for customizing the number of lines to save.

Then, press “q” to return back to the main menu.

Press 2 for setting up the auto-complete system. From there, press 1.

Now, everything is about to complete. If you’re an advanced user, you can surf through the options and make more changes as you like. After everything is complete, press 0 for saving the changes and exiting the shell.

Changing default shell

Now, ZSH is ready to use. However, it isn’t the default shell solution that terminal will load every time. For solving the issue, run the following commands:

sudo -s
which zsh
chsh -s /usr/bin/zsh

 

 

Now, reboot your system.

Voila! Your system is running ZSH. For having more customizability with your ZSH shell, you should install Oh My ZSH. It’s a lightweight and powerful tool for customizing ZSH. Here is all the usage of the tool.

You can even show asterisks when you type the password for “sudo”.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article