Step‑by‑Step Guide: Install and Configure Zsh on Ubuntu 20.04
This tutorial walks you through installing Zsh on Ubuntu 20.04, setting it as the default shell, configuring its initial options, using a quick .zshrc setup, and reverting back to Bash if needed, with all commands and screenshots included.
Installing Zsh
Zsh can be installed on Ubuntu using the apt package manager. Run the following command: sudo apt install zsh The latest version (5.8 at the time of writing) will be installed. Verify the installation with: zsh --version Output example:
zsh 5.8 (x86_64-ubuntu-linux-gnu)Making Zsh the Default Shell
After installation, Zsh is not automatically set as the default shell. Change the default for the current user with the chsh command: chsh -s $(which zsh) or explicitly: chsh -s /usr/bin/zsh Log out and log back in for the change to take effect.
Zsh Initial Configuration
When Zsh is launched for the first time, it presents a configuration wizard. Choose 1 to enter the main menu, where you can adjust history settings, completion behavior, key bindings, and other options. After making changes, press 0 to save.
Alternatively, you can let Zsh generate a default .zshrc file by selecting option 2 in the wizard, then edit the file manually if desired.
Key Zsh Features
Command‑line completion
Shared history across shells
Extended globbing
Improved variable and array handling
Compatibility with Bourne‑style shells
Spelling correction and command auto‑suggestions
Directory naming shortcuts
Quick .zshrc Setup
If you prefer not to walk through the wizard, you can populate .zshrc with default settings using:
autoload -Uz zsh-newuser-install zsh-newuser-install -fReverting to Bash
To remove Zsh and restore Bash as the default shell, execute:
sudo apt --purge remove zsh chsh -s $(which "SHELL NAME")Open a new terminal session to confirm the change.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
