How To Change Your Shell In Linux

In this quick and simple post I will show you how to find out which shell you are running, list all installed shells, and change shells in Linux. You can either do this temporarily by creating a subshell which will only last until you exit that session or you can permanently set a different shell to your default for all future sessions.

Find Out Current Running Shell

If you are unsure of which shell you are currently running then you can find out by running the following commands.

What Shell Am I Running

List All Installed Shells

If you want to see which shells you have available/installed on your system then you can find a list by checking in /etc/shells. You can also search for specific ones if need be using grep.

List Available Shells

Temporarily Change Shells

To temporarily change shells all you need to do is spawn a subshell. You can do this by using one of the following examples, although if you want to use a different shell then you will need to change the command to match your desired shell. Here are some examples of temporarily switching to a few of the more popular shells.

You can switch back to your default shell by running the command “exit” to end your subshell.

Change Shells Temporarily

Permanently Change Shells

You can permanently change your shells by using the chsh command. This command will prompt you for your password and then set your desired shell as your default login shell.

You can verify that your changes took by running the following command and changing the grep search string to your username (in this example I will use root).

Permanently Change Linux Shell

I hope this tutorial has helped you, more posts are always on the way! Please don’t forget to like, comment, or share!

Leave a Reply

Your email address will not be published. Required fields are marked *