how to install and setup zsh as default shell in ubuntu

1 min read

Ubuntu uses ‘bash’ as the default shell, and most Unix-like systems use bash as the default shell. However, there are many other options you can choose from. One of them is zsh (Z shell). It’s lightweight and loaded with many features to enhance your shell experience.

zsh
zsh
zsh

You can see detailed information about shell differences: see here

  • Context-based completion of many functions (like remote filename completion in ssh, makefile targets, configure scripts, and much more), which is highly configurable.
  • A powerful programming language with complex pattern matching mechanism (a pattern like **/*(^/) matches all (non-hidden) files in all subdirectories, but not directories themselves)
  • Lots of CLI (Command Line Interface) options and bindkeys
  • Loadable module support for adding built-in commands
  • Installation

    $ sudo apt-get install zsh
    $ chsh -s /bin/zsh

    Note: You’ll need to log out and log back in for the shell change to take effect. You can verify your current shell with echo $SHELL.

    Setup Oh My Zsh

    Oh My Zsh is a configuration framework developed by robbyrussell which provides many configuration options with built-in plugins and themes. You can customize zsh’s appearance as you want.

    $ sudo apt-get install git curl
    $ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

    You can configure zsh by editing the .zshrc file in your home directory.

    Useful Links



    • Home
    • About