Zsh (Z Shell) is a powerful and highly configurable shell, often preferred over the classic Bash for its advanced features such as enhanced autocomplete, advanced command history management, and support for themes and plugins. On Kali Linux, Zsh became the default shell starting from version 2020.4, replacing Bash to offer users a more modern and productive experience.
- Install Zsh
- Set Zsh as Default Shell
- Install Oh My Zsh
- Install Kali Linux Theme (Optional)
- Install Powerlevel10k (Recommended Alternative)
- Change Background Color
Install Zsh
This step installs Zsh on your Kali Linux system. Zsh is an alternative to Bash with many enhanced features, making your command line experience more productive and customizable.
Open the terminal and run:
sudo apt update
This updates the list of available packages to make sure you get the latest version of Zsh.
sudo apt install zsh -y
Installs the Zsh shell package. The -y
flag confirms installation automatically.
Verify the installation with:
zsh --version
This shows the installed version of Zsh to confirm it was installed correctly.
Set Zsh as Default Shell
This step changes your default shell from Bash (or any other shell) to Zsh, so each time you open a terminal, Zsh starts automatically.
To make Zsh the default shell, run:
chsh -s $(which zsh)
The chsh
command changes the login shell. $(which zsh)
finds the path of the installed Zsh binary.
Restart the terminal or manually start it with:
zsh
This starts the Zsh shell immediately without restarting.
Install Oh My Zsh
Oh My Zsh is a popular framework that helps manage your Zsh configuration easily by adding plugins, themes, and useful features.
First, install required tools:
sudo apt install curl git -y
This installs curl
(for downloading files) and git
(for cloning repositories), both necessary for installing Oh My Zsh.
Then install Oh My Zsh by running:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
This command downloads and runs the official Oh My Zsh installation script.
Install Kali Linux Theme (Optional)
This optional step installs the default Kali Linux Zsh theme, giving your terminal the same look and feel as Kali’s default setup.
Run the following to clone the Kali theme configuration:
git clone https://gitlab.com/kalilinux/packages/kali-defaults.git
Copies the Kali Linux default Zsh config to your home directory:
cp kali-defaults/etc/skel/.zshrc ~/.zshrc
Reload the configuration to apply the new theme immediately:
source ~/.zshrc
Install Powerlevel10k (Recommended Alternative)
Powerlevel10k is a fast, visually appealing, and highly customizable Zsh theme. It offers a rich prompt with useful information displayed elegantly.
Clone the Powerlevel10k theme repository to your Oh My Zsh custom themes directory:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Open your Zsh configuration file:
nano ~/.zshrc
Find the line that starts with ZSH_THEME=
and change it to:
ZSH_THEME="powerlevel10k/powerlevel10k"
Save and close the file (in nano, press Ctrl+O
to save and Ctrl+X
to exit).
Apply the changes by running:
source ~/.zshrc
Change Background Color
Customize your terminal’s background color to suit your preferences and improve readability.
- Open the terminal and access the settings menu.
- Go to the "Profiles" section and select your active profile.
- Find the "Background color" option and select your preferred color.
- Save the changes and restart the terminal to see the new background color applied.
Alternatively, if you're using Tilix or Alacritty terminal emulators, you can edit their configuration files directly to change colors and styles.