قالب وردپرس درنا توس
Home / Tips and Tricks / How to change the default shell in Bash under macOS Catalina

How to change the default shell in Bash under macOS Catalina



  Terminal window on a macOS Catalina desktop.

Under macOS Catalina, Apple now uses Zsh as the default shell. We love Zsh, but the trusted old bash shell is still included in macOS, and you can quickly switch back to bash if needed.

Zsh is just the default shell for newly created user accounts, that is, for all existing accounts. An updated Mac will continue to use Bash by default unless you change it. Each user account has its own default shell preference.

About the terminal

To change the default shell of a user account on macOS, just run the command chsh -s (change shell) in a terminal window.

Change the default shell to "Bash" by running the following command:

  chsh -s / bin / bash 

You must enter the password of your user account. Finally close the terminal window and open it again. They use Bash instead of Zsh.

 Change the default shell in Bash under macOS Catalina.

Change the default shell back to Zsh by running the following command:

  chsh -s / bin / zsh 

Enter your password when prompted. After closing and reopening the terminal window, use Zsh.

 Change the default shell in Zsh under macOS Catalina.

You can view a list of the shells that you can select Run the following command:

  cat / etc / shells 

 List the available shells in the terminal of macOS Catalina.

In System Settings

You can also change this option graphically in System Preferences if you prefer.

On Mac, go to System Preferences> Users and Groups. Click on the lock symbol and enter your password. Hold down the Ctrl key, click on the name of your user account in the left pane and select "Advanced Options".

 Opening advanced options in users and groups under macOS.

Click on the "Login Shell". Drop-down box and select "/ bin / bash" to use Bash as the default shell, or "/ bin / zsh" to use Zsh as the default shell. Click "OK" to save your changes.

 Changing the default login shell graphically in macOS Catalina.

Bash under macOS is still outdated.

Note that the version of Bash (Bourne Again SHell) is included in macOS, however, is still pretty much outdated. If you run bash --version you will notice that Catalina Bash contains 3.2.57 if Bash 5.0 is the latest release. Newer versions are licensed under the GPLv3 license, while Apple continues to distribute a GPLv2 licensed version.

In contrast, the version of Zsh (Z shell) is included in macOS (see zsh --version ). , Zsh is 5.7.2, the latest release at the time of Catalina's release.

 View the versions of Bash and Zsh on macOS Catalina.

If you want the latest version of Bash, you can install it yourself through Homebrew.




Source link