How to Install ZSH to Replace your Bash on Linux

Posted on

How to Install ZSH to Replace your Bash on Linux. ZSH or Z Shell is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.

How to Install ZSH

In this tutorial i am using Ubuntu. ZSH is already on Ubuntu repository and you can install it using apt.

sudo apt update && sudo apt install zsh

Or if you are using Fedora or CentOS, run this command

sudo dnf install zsh

Next, you need to change your default shell from bash to ZSH.

chsh $(whoami) -s $(which zsh)

Logout and login again to your desktop. After you open the terminal with zsh for the first time, you need to configure the .zshrc. Choose 2 for recommended configuration. (Populate your ~/.zshrc with the configuration recommended by the system administrator and exit (you will need to edit the file by hand, if so desired).)

Ok, you already install zsh with default interface. Next i will show you how to install Oh my ZSH, a delightful, open source, community-driven framework for managing your Zsh configuration.

Install Oh my ZSH

Install OMZ using installer with curl.

curl -L https://blog.linuxsec.org/oh-my-zsh | sh

Default theme for Oh My ZSH is robbyrussell, you can update it by modifying your .zshrc.

nano ~/.zshrc

Change the value of ZSH_THEME, example

ZSH_THEME="bira"

Reload your zsh configuration.

source ~/.zshrc

And this is the result.

For all available theme for Oh my ZSH, you can check it on Oh My ZSH Wiki.

Ok. So, that’s for today. Ask me everything if you have any problem with this tutorial. And dont forget to share it if you think it is helpful. Thank you and see you in the next tutorial.

Gravatar Image
Budak korporat yang hobi nulis. Pengguna Kali Linux sebagai daily driver. Kadang nonton anime di waktu luang.

Leave a Reply

Your email address will not be published. Required fields are marked *