The fish (friendly interactive shell) is a smart and user-friendly Unix shell. Its syntax is derived neither from the bourne shell nor from the c shell, so it is considered an exotic shell.
Unlike many other shells that disable many features by default to save system resources, the fish shell enables many of them to provide more features to its users.
In this article, I will discuss how to install and use the Fish shell in Fedora Linux.
Features of Fish shell
- Free and opensource
- It provides auto-suggestions based on previous commands executed.
- You can configure it through the web
- Provide advanced tab completion feature
- Syntax highlighting with strict error checking
- Supports for X clipboard
- It maintains searchable command history
How to install Fish shell on Fedora
In Fedora, the Fish shell is available in the default package repository of Fedora Linux. You can directly install it by using the dnf command.
Before you install a package on your system make sure the package repository is updated –
sudo dnf update
Now run the given command to install Fish on your system –
sudo dnf install fish
Press y and then enter if it asks for your confirmation.
Start using Fish shell
Once the installation of the fish shell gets completed. Use the given command to start using fish shell –
When you start typing a command in your terminal, based on previously run commands it automatically suggests the complete command in the light grey color you can see the example in the given image.
You can press the right arrow key to complete the command.
For using the tab completion feature first write a few words and then press the tab button to see the possible commands that can be used. You can see the example in the given image –
From the displayed list you can select a package by using the up and down key and then press the enter key to execute the command.
The fish shell highlights an invalid command by turning its color into red while valid commands are displayed in a different color. Similarly, a valid path gets underlined while invalid paths turn will be highlighted in red.
You can see the syntax highlighting example in the following image-
Configuring Fish shell
To configure shell write fish_config on the command prompt and press enter. This will open the configuration settings in your default web browser.
Here you can choose the color, set a new prompt, can see the history of commands executed, etc.
You can get back to bash by executing the exit command in your terminal.
Setting Fish As Default Shell in Fedora
Follow the below steps to set fish as your default shell –
First, locate the shell by using the given command –
Then run the following command –
chsh -s /usr/bin/fish
To set bash as your default shell again, use-
chsh -s /bin/bash
I hope you have successfully set up the Fish shell on your Fedora system. Now if you have a query or feedback then write us in the comments below.