How to Change Shell in Linux: A Practical Approach

This guide shows you how to change your Linux shell, making the switch from(to) Bash, Fish, Zsh, or any other shell a breeze.

Did you install a new shell on your Linux system and now want to make it your permanent choice? Or perhaps the new distribution you’re trying comes with a shell that doesn’t quite suit you, and you’d prefer to return to the familiar comforts of a good old Bash? No worries at all!

This guide will walk you through effortlessly changing your Linux shell in just a few minutes. Let’s get started.

Changing Your Linux Shell

In Linux, the shell acts as an intermediary between the user and the operating system, processing commands and returning output.

It’s important to understand that you can install multiple shells on your system and switch between them as needed. You can also temporarily change shells for a single session or permanently set 

Here’s how to check what shells are currently installed on your Linux system:

cat /etc/shellsCode language: Bash (bash)
Linux shells installed.
Linux shells installed.

To check which shell you are currently using, run:

echo $SHELLCode language: Bash (bash)
Checking which shell we use.
Checking which shell we use.

From the command output, it’s clear that we’re currently using Bash as our shell.

Switching Temporarily to Another Linux Shell

Suppose we’d like to switch to using Fish—assuming it’s already installed on our Linux system. To make the switch, we just need to enter the command fish.

Our terminal will immediately switch to it. Just type exit to leave the current shell and get back to Bash.

Temporarily switching between Linux shells.
Temporarily switching between Linux shells.

This is all helpful, but remember that these changes are only temporary. When you close the terminal or start a new one, it will revert to the default shell.

Switching Permanently to Another Linux Shell

However, if you want to permanently switch to a different shell, you’ll want to use the chsh (change shell) command. This utility allows a user to permanently change their default command-line shell in Linux.

The process is quite straightforward and involves two steps. First, you’ll need to locate the complete absolute path to the shell’s executable binary. To do this, simply run the command below and use only the shell’s name as an argument, in this case, “fish.”

which fishCode language: Bash (bash)

Next, run the chsh command with the “-s” option and provide the full path to the shell as an argument. When prompted, enter your user password and press “Enter” to confirm.

chsh -s /usr/bin/fishCode language: Bash (bash)
Permanently switching to a new Linux shell.
Permanently switching to a new Linux shell.

That’s it. You must log out for the changes to be applied. When you log back in, your new shell will be the default for your account. In addition, you can verify this by checking your account entry in the “/etc/passwd” file.

Permanently switching to a new Linux shell.
Permanently switching to a new Linux shell.

Bottom Line

Switching between Linux shells is quite straightforward and only involves executing a single command: chsh. With this tool, you can easily jump between different shells to find the one that suits you best. You can find more information regarding chsh on its manual page.

However, don’t forget that each shell has its configuration files where you can customize settings, aliases, functions, etc., or make visual improvements to suit your own tastes. Here are sample ones for the Bash shell.

Thanks for your time! We value your feedback and comments, so please feel free to share them in the section below.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%