Operations 5 min read

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.

ITPUB
ITPUB
ITPUB
Step‑by‑Step Guide: Install and Configure Zsh on Ubuntu 20.04

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 -f

Reverting 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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxtutorialzshCommand-line
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.