How To Change Your Default Shell From Zsh To Bash on Mac
With macOS Catalina, Apple switched from using bash as the default terminal shell to Zsh. The reason behind the switch, among other reasons, includes avoiding licensing obligations of GPLv3 license in the modern versions of bash, enhanced security, and adding new features. Zsh is an extension of bash, so you get all the benefits available in the latter, plus more.
But that’s not to say Zsh is identical to bash. bash is very popular in the GNU/Unix ecosystem, and you might prefer it over zsh. If you want to switch from Zsh to Bash as the default terminal shell on Mac, read on.
Check Available Shells on Mac
Like other GNU/Unix-based systems, macOS has several shells available installed by default. On macOS Sonoma, version 14.2.1, Apple has seven shells available (not necessarily installed), including bash, csh, dash, ksh, sh, tcsh, and zsh. You can check currently available shells on Mac by running the cat /etc/shells command from any location.
How to Switch from Zsh to Bash Shell on Mac
The simplest way to switch from zsh to bash (or any other available shell) is simply typing its name in the Terminal as a command. To switch from zsh to bash, enter the bash command in your Terminal and click Enter. But bash won’t be your default shell if you do that. You’ll have to re-run that command whenever you want to use bash instead of zsh.
To set bash as your default login shell and interactive shell on macOS, follow these steps:
- Open the Terminal app.
- Click Terminal in the top bar next to the Apple menu.
- Select Settings from the drop-down menu.
- Navigate to the General tab (if you’re not taken there directly).
- Under Shells open with, select Command (complete path) instead of the Default login shell option.
- Finally, change the command from /bin/zsh to /bin/bash and click Enter. This will set your default shell to bash.
After that, quit the Terminal by pressing Cmd + Q. Restart the Terminal, and bash will now be set as your default shell. macOS will scream at you when you open the shell that the “default interactive shell is now zsh.” This doesn’t mean that the current default shell on your system is zsh.
Instead, Apple tells you that the default shell on MacOS systems is zsh, and they prefer that you use that instead of bash. If you’d like to switch to zsh in the future, follow the steps above and choose Default login shell under Shells open with. Alternatively, provide the complete path to zsh instead of bash.