Have you implemented a fresh shell on your Linux setup and now wish to establish it as your permanent selection? Or maybe the latest distribution you’re experimenting with features a shell that doesn’t quite fit your preferences, and you’d rather return to the well-known comforts of a reliable Bash? No need to worry! This tutorial will guide you through seamlessly altering your Linux shell in just a matter of minutes. Let’s commence.
Procedure for Altering Your Linux Shell
Within Linux, the shell serves as a mediator between the user and the operating system, handling commands and returning outputs.
It’s vital to acknowledge that you can install multiple shells on your system and transition between them as required. You can also temporarily modify shells for a single session or configure them permanently.
To ascertain which shells are presently installed on your Linux system, execute the following command:
cat /etc/shells
Code language: Bash (bash)
To determine your current shell, type the following command:
echo $SHELL
Code language: Bash (bash)
![Checking current shell in use.](https://cdn.shortpixel.ai/spai/q_lossy+ret_img+to_auto/linuxiac.com/wp-content/uploads/2024/05/switch-between-linux-shells-02.jpg)
The output clearly indicates that our current shell is Bash.
Temporary Transition to Another Linux Shell
Suppose you desire to switch to Fish temporarily—provided it’s already installed on your Linux system. To make this shift, simply input the command fish
.
Your terminal will promptly switch to Fish. To return to Bash, just type exit
.
![Temporarily changing among Linux shells.](https://cdn.shortpixel.ai/spai/q_lossy+ret_img+to_auto/linuxiac.com/wp-content/uploads/2024/05/switch-between-linux-shells-03.jpg)
While this is helpful, remember that these adjustments are only temporary. Once you close the terminal or open a new one, it will revert to the default shell.
Permanent Transition to Another Linux Shell
Yet, if you wish to permanently transition to a different shell, employ the chsh
(change shell) command. This tool allows a user to permanently alter their default command-line shell in Linux.
The process is straightforward and involves two steps. First, determine the complete path to the shell’s executable binary by executing the following command, utilizing only the shell’s name as an argument, e.g., “fish.”
which fish
Code language: Bash (bash)
Subsequently, execute the chsh
command with the “-s” option, providing the full path to the shell as an argument. Upon prompt, enter your user password and press “Enter” to confirm.
chsh -s /usr/bin/fish
Code language: Bash (bash)
![Permanently transitioning to a new Linux shell.](https://cdn.shortpixel.ai/spai/q_lossy+ret_img+to_auto/linuxiac.com/wp-content/uploads/2024/05/switch-between-linux-shells-04.jpg)
That’s it. Log out for the changes to take effect. Upon logging back in, your new shell will become the default for your account. Additionally, you can confirm this by examining your account entry in the “/etc/passwd” file.
![Permanently transitioning to a new Linux shell.](https://cdn.shortpixel.ai/spai/q_lossy+ret_img+to_auto/linuxiac.com/wp-content/uploads/2024/05/switch-between-linux-shells-06.jpg)
Concluding Note
Swapping between Linux shells is simple and entails executing a single command: chsh
. With this utility, you can conveniently switch between different shells to find the one that best suits your needs. Refer to the manual page for further details on chsh
.
Nevertheless, each shell possesses its configuration files where you can tailor settings, aliases, functions, etc., or make visual enhancements to suit your preferences. Sample configurations are available for the Bash shell.
We appreciate your time! Your feedback and comments are valuable, so feel free to share them in the section below.