Shravan Kumar Kasagoni

Skip Navigation
How to change the default shell in Mac or Linux

How to change the default shell in Mac or Linux

 /  Leave a response

Below I have some useful commands to view/modify the shell in Mac or Linux.

View all available shells


$ cat /etc/shells

View the current shell


$ echo $SHELL

Change the current shell to zsh


$ chsh -s /bin/zsh

We should restart the terminal after executing the above command for the new shell to take effect. In the chsh -s we can pass any one of the available shells in the machine.

Restart the shell


$ exec -l $SHELL

Write a response

Your email address will not be published. Required fields are marked *

All code will be displayed literally.