Change the default shell on macOS
March 03, 2021Since 2019, Apple is favoring the zsh shell over Bash. The reason has not been made public, but logic dictates it is because of the licensing differences between Bash and zsh. Bash is GPL-licensed; zsh is released under the MIT-license which is less restrictive apparently. A writeup can be found here. I have been using Bash since forever and it is the default shell for all the Linux servers I manage at work. For me, it makes sense to keep using Bash on my laptops as well.
Setting the default shell to Bash
It’s not difficult to switch back to Bash when Apple -yet again- has changed the shell to zsh after a macOS update. Just open a Terminal window and type:
chsh -s /bin/bash
Verify the shell
To verify the shell has indeed changed to Bash, open a new Terminal window and type:
echo $SHELL
Example output:
/bin/bash
Depending on the shell you use, the shell prompt might also look different. Bash uses a dollar sign instead of the precentage sign used by zsh for example.
Available shells
In case you’re curious what shells are available to you, it’s easy to list them. In a Terminal window, type:
cat /etc/shells
This will produce output like:
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.
/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
Thoughts
Zsh does have advantages over Bash, some of which can be read here.