How to Re-change the SHELL to default bash instead of zsh

Viewed 3077
  1. Initially had bash as default shell prompt and the ~ had .bashrc, .bash_profile etc file.
  2. To try zsh, I installed the zsh locally and also have the .zshrc in the ~ path.
  3. Then to have the default shell as zsh, I tried chsh -s ~/local path/zsh pointing to my local zsh. After entering the password, it got changed and was able to run and test things.
  4. Now, when I tried going back to default shell of bash, using the same command in step 3, it says the shell got changed. Then I closed the terminal and re-opened and it keep showing the zsh as default with that usual zshell configuration prompt.
  5. I tried removing all the .zshrc etc etc. and reopened the terminal again, but its not changing. Also tried killing the vnc session and re-opened a new one and the result is same.

I am confused what am I supposed to do now to get back to the default bash shell. Please let me know. Thanks.

  1. Used the following command: chsh -s /bin/bash It asked for default password, after entering it says Shell Changed.

  2. When I try grep bash /etc/shells it shows, /bin/bash /usr/bin/bash

  3. I closed the terminal and re-opened and it stays to the same default zsh and ask to configure the zshell prompt.

2 Answers

If you want to change default shell use chsh -s "$(which bash) under the your account.

After this you must to relogin.

Bash doesn't read .zshrc, and even if you'll remove this, nothing happened. To understand, what is the shell you are using, try this command:

➭ ps -p $$
    PID TTY          TIME CMD
  14321 pts/4    00:01:01 zsh

Or show $SHELL variable content:

➭ echo ${SHELL}
/usr/bin/zsh

If you use Bash and your prompt doesn't look "normally", you just can change this in the ~/.bashrc or ~/.profile files.

Related