Every Linux system supports multiple shells. By default, every Linux distribution has a default shell assigned for each user. This is the shell we get when we open terminal on our Linux system. You can always change this shell after you have started terminal session. But sometimes you may need to change this default shell itself instead of changing it every time, since it does not meet our requirements. In this article, we will learn how to change default shell in Linux.
How to Change Default Shell In Linux Here are the steps to change default shell in Linux.
1. List All Shells If you are sure about the new shell that you want to switch your default shell to, then you can skip this step. Else run the following command to list all available shells on your system. Every Linux system ships with multiple shells. $ cat /etc/shells
You will see the following kind of output. /bin/sh /bin/bash /sbin/nologin /bin/tcsh /bin/csh /bin/dash
It lists the full path for each shell such as cshell, bash, etc. Note the full path of the shell you want to switch to.
2. Change Default Shell Linux provides chsh command to change default shell for user. Let us say you want to set default shell to csh. In this case, run the following command to change shell.