X

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 View the current shell Change the current shell to 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…

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

Shravan Kumar Kasagoni: