macOS Change Shell

I recently purchase a 2019 27" iMac from the Apple refurbished store to use as my main desktop machine at home. Compiles now fly and I love the 5K screen resolution.

The only problem is that I reinstalled Catalina from scratch and realized that Apple has changed the default shell from bash to zsh. The version of bash installed is very old so I decided to upgrade to a newer version of bash (as of this writing, 5.0.16). I have a lot of scripts I use for development and I don’t want to rewrite them.

To get the latest version of bash, I use Homebrew:

brew install bash

Since Homebrew installs to /usr/local/bin, you need to update your system shells and add /usr/local/bin/bash to the end of the /etc/shells file:

sudo vi /etc/shells

After you add bash you can use the chsh command to change your shell:

chsh -s /usr/local/bin/bash

Stop and restart your terminal sessions to get the new version of bash.