Set zsh as the default shell in your terminal.

Ismael Garcia - Apr 1 '20 - - Dev Community

How to set ZSH as the default shell in your terminal.

ZSH also called the Z shell, is an extended version of the Bourne Shell (sh), with plenty of new features, and support for plugins and themes. Since it’s based on the same shell as Bash that makes it easy for use and switching over is a breeze.

Open vim or your favorite code editor

sudo vim ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Now we need to edit the file and add the following line to the end of the file remember to add a comment just to remember, what is that line of code task.

exec zsh
Enter fullscreen mode Exit fullscreen mode

It will execute the command every time you load the terminal and run your zsh shell.

This is not the only way that you can get to the goal of setting zsh as the default shell but for me, this is the best and easy way to do the job.

Please if you have a better solution let me know I'm willing to learn new ways and do it in a better way.

Update

The best solution is just use the fallowing command to switch

chsh -s $(which zsh)
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .