zsh a Default Terminal Shell

Monday, 20 August 2018

I prefer zsh over bash as my everyday shell. Unfortunately zsh is not the default shell on macOS.

To make it as a default shell for your machine, simply do the following:

1. Install zsh

Make sure zsh is available on your system. If not, install it with brew.

$~ brew install zsh

$~ which zsh
/usr/local/bin/zsh #output

2. Set zsh as default shell

To set is as default shell, run the following in your terminal:

$~ sudo sh -c "echo $(which zsh) >> /etc/shells"
$~ chsh -s $(which zsh)

Then, simply reopen your shell again and it should used zsh as the default shell. That’s it.

To check which shell you’re using

If you are still unsure whether your shell is running zsh or bash, run the following in your terminal:

$~ echo $0
-zsh  #output

✌️