Set zsh as the default shell in your terminal. (2024)

Set zsh as the default shell in your terminal. (1)

Set zsh as the default shell in your terminal. (2)

Ismael Garcia

Posted on • Updated on

Set zsh as the default shell in your terminal. (3) Set zsh as the default shell in your terminal. (4) Set zsh as the default shell in your terminal. (5) Set zsh as the default shell in your terminal. (6) Set zsh as the default shell in your terminal. (7)

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

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

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)

Top comments (5)

Subscribe

Set zsh as the default shell in your terminal. (9)

Ihor Vorotnov

  • Location

    Dnipro, Ukraine

  • Work

    Web and Software Developer

  • Joined

• Edited on • Edited

You aren't actually making it a default shell, your shell is still /usr/bin/bash. You are just executing a ZSH framework on top of bash shell and the only environment where it makes sense is Cygwin on Windows. On all other operating systems you'd be better off by actually making it your default login shell with a standard chsh command chsh -s $(which zsh). It's even easier, isn't it? And won't bite you back if you're developing shell scripts.

Set zsh as the default shell in your terminal. (11)

Ismael Garcia

Always ask questions to feed the curiosity and learn something new on the way. El respeto al derecho ajeno es la paz. Benito Juarez Garcia.

• Edited on • Edited

Thank you for the information and for the better solution I really appreciated.
Yeah, you are right it is better to make it the default login shell.

I'm not developing scripts for now, but like you said you never know in the future right.

Set zsh as the default shell in your terminal. (13)

Could be good if @leamsigc update this post because google ranks it on pretty good place. It's very bad solution and nonsense.
@ihorvorotnov said the correct way.

Set zsh as the default shell in your terminal. (15)

Tem326

arch based distros too unstable might downgrade all the way to pop_os

  • Joined

Why would you ever want to edit your bashrc as root?

Set zsh as the default shell in your terminal. (17)

GoldCoin

Game Dev

  • Location

    Morocco

  • Work

    GoldCoin at student

  • Joined

thank you bro it workes fine

For further actions, you may consider blocking this person and/or reporting abuse

Set zsh as the default shell in your terminal. (2024)
Top Articles
Latest Posts
Article information

Author: Jonah Leffler

Last Updated:

Views: 5765

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Jonah Leffler

Birthday: 1997-10-27

Address: 8987 Kieth Ports, Luettgenland, CT 54657-9808

Phone: +2611128251586

Job: Mining Supervisor

Hobby: Worldbuilding, Electronics, Amateur radio, Skiing, Cycling, Jogging, Taxidermy

Introduction: My name is Jonah Leffler, I am a determined, faithful, outstanding, inexpensive, cheerful, determined, smiling person who loves writing and wants to share my knowledge and understanding with you.