Mutiple Linux shells on a same system
Recently I came across the question is there any possibility that multiple shells can be installed on the same system and can be used interactively???
Being a #linux user I quickly answered yes!!! why not.
Question raised how?
So, here's my answer in 3 Easy steps...
1 - Simply install the shell you want to use.
2 - Change the shell.
3 - Start Using the Shell.
Simple, isn't it?
So now let's have a look
First of all you need to have a Linux system with a internet. First thing first... just for you information for most of Linux distribution Bash or Sh is a default shell. But that doesn't means that you cannot change or install default shell... Why? remember from your first Linux class Linux is OpenSource and provides the capability to customize as much as you want unless there's a Code or technology limitation and by saying that I literally mean it... As In Linux since everything is considered as a file so unless there's a binary or you know(aware) pretty much about what you're doing Linux is a very powerful tool you can have in your toolbox.
Installation:
Enough now, First for all the major shells i.e.
Now, to install you can simply type
$ sudo apt install zsh ksh fish -y
for Debian or Ubuntu based distro and for Fedora based distribution type
$ sudo dnf -y install zsh ksh fish
Now, wait for few seconds or minutes depending on your system configuration it will install all the shells i.e. ksh, zsh and fish
Each shell has it's own features try them all but don't stay on one
Recommended by LinkedIn
Changing the shell:
So, as we know that our shells are installed now, in order to use shell, there are two methods...
$ chsh -s $(which zsh)
$ chsh -s $(which ksh)
$ chsh -s $(which fish)
You can use any of the commands mentioned as per your mood for the shell you want to try
If you're opting for the second option then after changing the shell you need to logout and then login again in order to use the new shell.
In some distribution, you may not have to logout even simply closing a terminal window and opening again might do the work for you.
Note:
For the above command don't use sudo otherwise instead of user the shell will be changed for root user. use the command only for the user you want to change the shell.
So that's It for now I will be back soon with another writeup
Till then if you want check out my other's blogs too
Thanks
- SK -