Notes

Install Z-shell and Oh My Zsh on Ubuntu 20.04 LTS

Edit on GitHub

System Administration
2 minutes
 1# install ZSH
 2sudo apt update && sudo apt install -y zsh
 3
 4# Set ZSH as default shell
 5chsh -s $(which zsh)
 6
 7# logout and log back in for the shell change to take effect..
 8
 9# confirm shell has been changed
10echo $SHELL # /usr/bin/zsh
11
12# instll oh-my-zsh
13sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

As part of the installation, it’ll ask you if you want to change your default shell to zsh. Say yes.

The ~/.bashrc is replaced with ~/.zshrc. And the default installation location is ~/.oh-my-zsh, this is where you install themes and plugins.

Aliases

  • You can get a list of all active aliases by running alias
  • New aliases can be defined at the end of ~/.zshrc, although it’s recommended that you add them inside your ZSH_CUSTOM folder.
  • You can creates an aliases.zsh file in the ZSH_CUSTOM folder
  • Files in the ZSH_CUSTOM folder are loaded by the init script, in alphabetical order

Since i already had a .bash_aliases file, i just copied the contents over

1touch ~/.oh-my-zsh/aliases.zsh
2cat ~/.bash_aliases >> ~/.oh-my-zsh/custom/aliases.zsh
3
4source ~/.zshrc

You can then confirm your aliases are loaded with alias.

NOTE: You may have to go over your aliases file and change the double quotes to single quotes.. something about execution at run time or some such

Installing plugins

1plugins=(git cp colored-man-pages colorize)

Installing themes

I have my own theme that i install on every system..

1
2export ZSH_THEME="amnastic"

ZSH_CUSTOM