How to set zsh as the default terminal shell

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 <code>zsh</code>

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

1$~ brew install zsh
3$~ which zsh
4/usr/local/bin/zsh #output

2. Set <code>zsh</code> as default shell

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

1$~ sudo sh -c "echo $(which zsh) >> /etc/shells"
2$~ 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&rsquo;re using

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

1$~ echo $0
2-zsh  #output