Skip to content Skip to footer

How to change the default shell in Mac or Linux

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

Leave a comment

0/100