Operations 5 min read

How to Install and Configure Zsh on Ubuntu 20.04

This guide walks through installing Zsh on Ubuntu 20.04, setting it as the default shell, configuring initial options, and reverting to Bash, providing step‑by‑step commands and screenshots for each stage.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Install and Configure Zsh on Ubuntu 20.04

This article explains how to install and configure Zsh (Z Shell) on Ubuntu 20.04, applicable to all Ubuntu‑based distributions. Zsh is an extended Bourne shell that incorporates features from Bash, Ksh, and Tsh.

Zsh Features

Command‑line completion

Shared history across shells

Extended globbing

Improved variable and array handling

Compatibility with Bourne‑type shells

Spelling correction and command auto‑completion

Directory naming

Installing Zsh via APT

Use the APT package manager to install the latest Zsh version (5.8): sudo apt install zsh Verify the installation: zsh --version Output:

zsh 5.8 (x86_64-ubuntu-linux-gnu)

Setting Zsh as the Default Shell

Check the current shell: echo $SHELL Change the default shell with chsh: chsh -s $(which zsh) or directly: chsh -s /usr/bin/zsh Log out and log back in for the change to take effect.

Initial Zsh Configuration

On first launch, Zsh presents a configuration menu. Choose option 1 to enter the main menu, then configure history settings, key bindings, and other options. Use numeric selections (e.g., 1, 2, 3) to modify parameters. After making changes, press 0 to save.

Alternatively, select option 2 to generate a default .zshrc file, then edit it manually.

Restoring Bash

If you need to revert to Bash, remove Zsh and reset the default shell:

sudo apt --purge remove zsh
chsh -s $(which bash)

Open a new session to confirm the change.

Additional Notes

The guide includes screenshots illustrating each step, but the core instructions are the commands and configuration choices described above.

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.

Shellcommand-lineInstallationUbuntuzsh
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

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.