> ## Content Index
> Fetch the complete content index at: https://linuxhandbook.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Change Shell in Linux
- URL: https://linuxhandbook.com/change-shell-linux/
- Published: 2019-03-19T06:33:07.000Z
- Updated: 2023-12-12T05:06:48.000Z
- Description: This quick tutorial shows how to check the running shell, available shell in the system and how to change the default shell in Linux.
- Author: Abhishek Prakash
- Tags: Tips

You probably are already aware that there are several shell available on Linux and other Unix-like systems. Bash is the default shell on almost all the Linux distributions but there are some other popular shells available such as:

- ksh
- [zsh](https://en.wikipedia.org/wiki/Z%5Fshell?ref=linuxhandbook.com)
- fish
- csh
- [dash](https://linuxhandbook.com/dash-shell/)

Some of the shells provide additional features in a more user-friendly way. Take [Fish shell](https://fishshell.com/?ref=linuxhandbook.com) for example. It partially starts showing you command hints based on your previous typed command. It’s quite handy if you don’t want remember the [Linux terminal shortcuts](https://linuxhandbook.com/linux-shortcuts/) all the time.

Let’s see a few things around shell in your Linux system.

## How to know the default shell?

To know the default shell set for you in your Linux system, you can check the SHELL environment variable. Usually, the default shell is bash and it is shown like this:

```
echo $SHELL
/bin/bash
```

## How to see what shell are you currently using?

There is no single method that will tell you [which shell you are using](https://linuxhandbook.com/shell-using/) with 100% accuracy.

You can try either **echo $0** that shows you an output like this:

```
echo $0
zsh
```

or check the process using **ps -p $$** like this:

```
ps -p $$

  PID TTY          TIME CMD

 9625 pts/0    00:00:00 zsh
```

## How to see all the shells available on your Linux system?

All the shells available on your Linux systems are listed in the file `/etc/shells`. You can [use cat command](https://linuxhandbook.com/cat-command/) or [less command](https://linuxhandbook.com/less-command/) to [view the content of the file](https://linuxhandbook.com/view-file-linux/).

```
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/bin/rbash
/bin/dash
/usr/bin/tmux
/usr/bin/fish
/bin/zsh
/usr/bin/zsh
```

## How to change the shell to use another one?

If you want to use a different shell, you can simply type its name and you’ll be logged into the new shell. For example, if you [install zsh](https://linuxhandbook.com/install-zsh/) and want to use it, you can simply use:

```
zsh
```

You can enter exit to exit from the new shell and return to the previous one.

## How to change the default shell in Linux permanently?

Suppose you liked the Fish shell a lot and you want to use it as your default shell so that every time you open the terminal or ssh into the system, you are using it instead of the default bash shell.

Linux allows you to change the default shell using the chsh command. The best way to change the default shell for your own logged in user is by specifying the shell name listed in the /etc/shells file with the -s option.

```
chsh -s /usr/bin/fish
```

You must log out of the system so that the changes take into effect; otherwise you’ll think that running chsh didn’t change the shell.

📋

Did you notice that I had to specify the full path as it was listed in the /etc/shells file? If I had used chsh -s fish, it would have given me an error like “chsh: fish is an invalid shell”.

## **Which shell do you like?**

Now that you know how to change shell, you may also read [how to change users in Linux](https://linuxhandbook.com/change-user-command-line/).

I hope this little article helped you to change the shell in Linux. If you have thought about changing the default shell, perhaps you use something other than the bash shell. Which shell is it? Why do you prefer it over the others?

Do share your views in the comments below.