Change the default shell in Terminal on macOS | Zsh or Bash shell M1

Опубликовано: 14 Апрель 2026
на канале: Chhaileng Tim
565
2

To change the default shell in Terminal on macOS from the current shell (e.g., Bash) to another shell (e.g., Zsh), follow these steps:

Check Available Shells:

Open Terminal.

To see the list of available shells on your system, run the following command:

bash
Copy code
cat /etc/shells
This will display a list of available shells. Make note of the shell you want to switch to (e.g., Zsh).

Change the Default Shell:

To change your default shell to Zsh (or any other shell), run the following command, replacing /bin/zsh with the path to the shell you want to use (e.g., /bin/zsh for Zsh):

bash
Copy code
chsh -s /bin/zsh
Enter your user password when prompted.

If you want to switch back to Bash, replace /bin/zsh with /bin/bash in the command above.

Log Out and Log In (or Restart):

To apply the changes, you should log out of your macOS account and log back in. Alternatively, you can restart your computer.
Verify the Change:

After logging back in or restarting, open Terminal again.

To confirm that your default shell has changed, you can run the following command:

bash
Copy code
echo $SHELL
It should display the path to the new default shell (e.g., /bin/zsh for Zsh).

Now, your default shell in Terminal on macOS should be the one you selected (either Zsh or Bash, depending on your choice). You can start using the new default shell for your terminal sessions.