Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Change zsh to bash on Mac: 3 Quick Ways

· 5 min read · Home Tech

In this article
  1. Why Macs Use zsh by Default
  2. Method 1: Change the Default Shell with chsh
  3. Method 2: Change the Shell in System Settings
  4. Method 3: Set Bash as the Shell for a Single Terminal Session
  5. Verifying the Change
  6. Common Issues and Troubleshooting
  7. Bash vs. Zsh: Key Differences
  8. Frequently Asked Questions

To change your Mac's default shell from zsh to bash, open Terminal and run chsh -s /bin/bash, then enter your password. After restarting Terminal, the prompt will use bash instead of zsh. This article explains the three ways to make the switch, how to verify it worked, and what to do if you run into issues.

Why Macs Use zsh by Default

Since macOS Catalina (released in 2019), Apple has made zsh the default login shell for new user accounts. The previous default, bash, is still included with macOS, but it is an older version (3.2) due to licensing constraints. Apple chose zsh because it is more modern, has better scripting features, and is compatible with the GNU General Public License version 3, which newer bash versions use. This means when you open Terminal on a current Mac, you are almost certainly using zsh unless you or your organization changed it.

Method 1: Change the Default Shell with chsh

The simplest way to switch your default shell to bash is using the chsh command. This changes the shell for your user account, so every new Terminal window will open with bash.

  1. Open Terminal (from Applications > Utilities).
  2. Type chsh -s /bin/bash and press Return.
  3. Enter your macOS password when prompted.
  4. Quit Terminal (Command+Q) and reopen it.
  5. Run echo $SHELL to confirm it shows /bin/bash.

This method works on all recent macOS versions. If you prefer to use the full path, /bin/bash is correct on Intel and Apple Silicon Macs.

Method 2: Change the Shell in System Settings

For users who prefer a graphical interface, macOS provides a setting in System Settings (or System Preferences on older versions).

  1. Open System Settings (Apple menu > System Settings).
  2. Select "Users & Groups" from the sidebar.
  3. Click the lock icon and enter your password to make changes.
  4. Control-click (or right-click) your user name and choose "Advanced Options".
  5. In the "Login shell" dropdown, select /bin/bash.
  6. Click OK, then close System Settings.
  7. Reopen Terminal to see the change.

Note: The exact wording may vary slightly depending on your macOS version, but the steps are the same for Catalina through the latest releases.

Method 3: Set Bash as the Shell for a Single Terminal Session

If you only want to use bash temporarily without changing your default, you can simply type bash in a Terminal window. This starts a bash shell inside the current zsh session. To exit back to zsh, type exit. This is useful for testing scripts or using bash-specific features without permanently switching.

Verifying the Change

After changing your default shell, it is important to confirm the switch worked. Open a new Terminal window and run:

  • echo $SHELL – should output /bin/bash.
  • echo $0 – should output -bash or bash.
  • ps -p $$ – shows the current shell process, which should be bash.

If any of these still show zsh, the change did not take effect. Check that you entered the correct path and that you restarted Terminal completely.

Common Issues and Troubleshooting

Some users encounter problems when switching to bash. Here are the most frequent ones:

  • "chsh: /bin/bash: non-standard shell" – This warning appears because macOS considers bash a non-standard shell. It is harmless; the change still works. You can ignore it.
  • Shell reverts to zsh after reboot – This usually happens if you changed the shell in System Settings but did not click the lock to save. Recheck the setting.
  • Bash commands not found – Your bash profile may not be loading. Check for a .bash_profile or .bashrc file in your home directory. If they do not exist, create them with touch ~/.bash_profile.
  • Terminal opens with zsh anyway – Some Terminal profiles have a custom command set. Go to Terminal > Settings > Profiles > Shell and make sure "Run command" is unchecked.

Bash vs. Zsh: Key Differences

If you are switching, you might wonder what changes. Bash and zsh are both powerful shells, but they have some differences:

  • Prompt customization – Zsh offers more advanced theming options, like Powerlevel10k, while bash requires more manual configuration.
  • Auto-correction – Zsh can auto-correct typos in commands, a feature bash lacks by default.
  • Scripting compatibility – Bash scripts generally run in zsh, but not always the other way around. Zsh has some syntax that bash does not understand.
  • Default features – Zsh has better tab completion and spelling correction out of the box.

For most everyday tasks, the difference is minimal. If you rely on bash-specific scripts, switching back makes sense.

Frequently Asked Questions

Will changing my shell affect my existing zsh configuration?

No. Your .zshrc file remains untouched. When you switch to bash, bash will use .bash_profile or .bashrc instead. You may need to copy over any aliases or environment variables you want to keep.

Can I switch back to zsh later?

Yes. Simply run chsh -s /bin/zsh or change the login shell in System Settings back to /bin/zsh. Your zsh configuration will still be there.

Is bash on macOS the same as bash on Linux?

Not exactly. macOS includes bash version 3.2, which is older than the 5.x versions commonly found on Linux. Some newer features and syntax are not available. If you need a newer bash, you can install it via Homebrew, but that is a separate setup.

Why is the default shell zsh instead of bash?

Apple switched to zsh because bash 3.2 is outdated and bash 4+ uses a license (GPLv3) that Apple avoids. Zsh is more feature-rich and actively maintained, making it a better long-term choice for macOS.

What if I use a script that requires bash?

You can still run bash scripts even if your default shell is zsh. Simply invoke them with bash script.sh or add a shebang line #!/bin/bash at the top of the script. This works regardless of your default shell.