zsh

How to Change Default Shell from Zsh to Bash Mac

If you are a Mac user and have been using Zsh as your default shell, but now want to switch to Bash, you might be wondering how to do it. Changing your default shell is a straightforward process that lets you use Bash instead of Zsh for your command line tasks.

In this article, you will find the required steps to change your default shell from Zsh to Bash on your Mac.

Change Default Shell from Zsh to Bash Mac

To change your default shell from Zsh to Bash on Mac, follow the below-given steps:

Step 1: First, confirm that you are currently using Zsh as your default shell; for that purpose, open your Mac terminal and execute the command given below:

echo $SHELL

The above output /bin/zsh confirms that Mac is using Zsh as the default shell.

Step 2: Now, to switch from Zsh to Bash, execute the following command:

chsh -s /bin/bash

Step 3: You will be prompted to enter your password, which you have to do so that the password will then be associated with your user account.

Step 4: Close the current terminal session and open the terminal again.

Step 5: To verify that your default shell has been changed to Bash, enter the following command again in the terminal:

echo $SHELL

The output /bin/bash confirms that you have successfully changed your default shell to Bash.

Optional: Once you have switched to Bash, you can customize its behavior by modifying the .bashrc or .bash_profile files in your user directory. These files allow you to define aliases, set environment variables, and configure various aspects of your Bash shell.

Conclusion

Changing your default shell from Zsh to Bash on your Mac is a simple process that allows you to personalize your command line experience. Though Mac uses the Zsh as a default shell, you can switch it to bash by following the steps outlined in this article. After successfully performing the steps, you can seamlessly switch to Bash and take advantage of its features and customization options.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.