Install ZSH on Mac using homebrew

ZSH is my favorite shell; it offers nice features like autocomplete with menus, remote autocomplete, commands correction, etc.

Install ZSH is easy using homebrew, the only thing we have to do is use this command in the terminal:

brew install zsh

Now to make ZSH the default shell we have to add the ZSH executable to the end of this file /etc/shells, like this:

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/zsh

Note: you need root permissions to edit the /etc/shells file.

Once we modified the file, we have to insert this command in the terminal to change the shell for the current user from BASH to ZSH:

sudo chsh -s $(which zsh)

And that is all we have to repeat the las step for all users or specify the username in the end:

sudo chsh -s $(which zsh) another-username