Using the Fish shell is one of the many ways you can elevate your terminal experience in the terminal.
But before you make the switch, let me remind you that fish shell is not POSIX-compatible and it handles a few operations differently.
In simple terms, some tasks on fish are different than bash (the default shell of bash) so make sure you know how fish is different than the bash shell.
Once you learn the difference, you can use any of these two methods of installing Fish Shell in Ubuntu (which I'll be sharing in a moment):
- Using the default repository (easy)
- Using fish PPA (contains extra steps but gets the latest version)
Let's start with the easy one.
Install Fish Shell using the default repository
This is the easiest method of installing the fish shell where all it takes is one simple command and that's it.
The only downside of this method is you get a little older version.
If you don't mind using a slightly older version, then, execute the given command:
sudo apt update && sudo apt install fish
Once done, you can check the installed version of fish using the following command:
fish -v
While writing, it gave me fish shell version 3.3.1
.
You can start the fish shell just after installation by executing the fish
command in the terminal prompt:
fish
To quit the fish shell, simply execute the exit command as shown:
exit
Install the latest version of the fish shell
If you want to get the latest version of the fish shell, then you'd have to use the fish shell's PPA for that purpose.
First, execute the following command to add PPA to your system:
sudo apt-add-repository ppa:fish-shell/release-3
Then, update your system repository to take effect from the changes you've made to your system:
sudo apt update
Once done, install the fish shell using the following command:
sudo apt install fish
Now, you can check the installed version:
fish -v
As you can see, I'm running Fish version 3.6.4.
Make the Fish default shell
Earlier, I explained how you can use the fish
command to use the fish shell but it was temporary. But you can make it your default shell.
To change your default shell, all you have to do is use the chsh command as shown:
chsh -s /usr/bin/fish
Now log out and log back in. You will notice that fish is being used as a default shell.
Here's why fish is superior to bash
If anyone is switching from their comfort zone (bash in this case), they must have a strong reason to do so, and guess what? I have 11 reasons why.
Here are 11 reasons why fish is better than the bash shell:
Let me know what was your reason for making a switch.