How to install Fish shell in Fedora Linux?


A Unix shell is a program that interprets the command or script and acts as an intermediary between the user and kernel of the system. Bash, zshcsh, and fish are some examples of Unix shells.

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.

fish shell install

Start using Fish shell

Once the installation of the fish shell gets completed. Use the given command to start using fish shell –

fish

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.

autosuggestion fish

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 –

tab completion

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-

sytax highlighting

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.

fish_config

fish configuration

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 –

whereis fish

fish shell

Then run the following command –

chsh -s /usr/bin/fish

To set bash as your default shell again, use-

chsh -s /bin/bash

Conclusion

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.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.