How to Change Shell in Linux
1. Check Available Shells
First, you may want to see which shells are available on your system. You can check this by looking at the /etc/shells
file:
cat /etc/shells
2. Change Your Shell
To change your shell, use the chsh
command followed by the -s
option and the path of the new shell you want to use. For example, to change to zsh
, you would do:
chsh -s /bin/zsh
Make sure to replace /bin/zsh
with the path of your desired shell.
3. Log Out and Log Back In
After changing your shell, you need to log out and then log back in for the changes to take effect. Alternatively, you can restart your terminal session.
4. Verify the Change
You can verify that your shell has changed by running:
echo $SHELL
This should display the path to the shell you switched to.
Note
If you don’t have permission to change your shell, you might need to contact your system administrator. Also, ensure the new shell is installed on your system; otherwise, the change will not work.
Example: Changing to Bash
If you wanted to switch back to bash
, you would run:
chsh -s /bin/bash
That's it! You’ve successfully changed your default shell in Linux.
0 Comments