Choosing a Shell - northwood-labs/macos-for-development GitHub Wiki
See Determining your shell first.
Z-Shell
Z-Shell is the default shell for new setups as of macOS 10.15 “Catalina” (October 2019). This is a popular, modern shell that can also emulate Bash. It has some popular extensions in the form of Oh My Zsh, Powerlevel10k, and Starship.
This shell is pre-installed.
Bash 3.2
Bash was the default shell for all new setups from Mac OS X 10.3 “Panther” (October 2003) through macOS 10.14 “Mojave” (September 2018). Unfortunately, Bash 4.0 changed their license from GPL 2.0 to GPL 3.0, which is largely incompatible with most corporations. As a result, Apple was unable to legally upgrade Bash beyond version 3.2.57.
Any shell script that begins with #!/bin/bash is executed with this version of Bash.
This shell is pre-installed.
Bash 5
Bash can be upgraded to a modern version by installing from Homebrew . This is a version of Bash that is licensed as GPL 3.0. Apple cannot agree to this license, but you can. A more complete tutorial can be found at Configuring modern Bash as the default shell for macOS.
This shell is NOT pre-installed, but you can install it via Homebrew.
brew install bash
sudo bash -c "echo $(brew --prefix bash)/bin/bash >> /etc/shells"
chsh -s $(brew --prefix bash)/bin/bash
You can use this modern Bash by defining #!/usr/bin/env bash at the top of a shell script.
Others
Most other shells are pretty uncommon on macOS. There's nothing inherently wrong with them, they're just far less common.
- Comparison of command shells
- C Shell (
csh) — Preinstalled, but not default. - TCSH (
tcsh) — Preinstalled, but not default. - KornShell (
ksh) — Preinstalled, but not default. - Fish (
fish)