Fish is a smart and user-friendly command line shell for Linux, macOS, BSD and Windows operating systems. This shell is designed to give user powerful features and control without compromising speed and efficiency. In this article we will show you how to install and configure Fish shell on majority of Linux distributions.

Fish shell has the following features.

  • Autosuggestions: This shell is able to suggest commands as you type based on history and completion
  • Web Based Configuration: You can set your colors and view functions, variables, and history all from a web page if you have graphical interface in your system.
  • Man Page Completions: Fish generated programmable completions by parsing your installed man pages.
  • Sane Scripting: The fish shell is fully scriptable with simple, clean and consistent syntax.
  • Glorious VGA Color: Has support for 24 bit true color
  • No configuration needed: fish is designed to be ready to use immediately, without requiring extensive configuration.

Install and Configure Fish shell on Linux

In the next sections I’ll show you how easy it is to install and configure fish shell in your Linux system.

Install Fish shell on Ubuntu:

sudo apt update
sudo apt install fish

Or from PPA repository:

sudo apt-add-repository ppa:fish-shell/release-3
sudo apt-get update
sudo apt-get install fish

Install Fish shell on Debian 10:

echo 'deb http://download.opensuse.org/repositories/shells:/fish/Debian_10/ /' | sudo tee /etc/apt/sources.list.d/shells:fish.list
curl -fsSL https://download.opensuse.org/repositories/shells:fish/Debian_10/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/shells_fish.gpg > /dev/null
sudo apt update 
sudo apt install fish

Install Fish shell on Debian 9:

echo 'deb http://download.opensuse.org/repositories/shells:/fish/Debian_9.0/ /' > /etc/apt/sources.list.d/shells:fish.list 
wget -nv https://download.opensuse.org/repositories/shells:fish/Debian_9.0/Release.key -O Release.key 
sudo apt-key add - < Release.key 
sudo apt-get update 
sudo apt-get install fish

Install Fish shell Fedora:

sudo dnf install fish

Install Fish Shell on CentOS 8:

sudo yum -y install wget
wget https://download.opensuse.org/repositories/shells:fish:release:3/CentOS_8/shells:fish:release:3.repo -O fish.repo
sudo mv fish.repo /etc/yum.repos.d/
sudo yum install fish

Install Fish Shell on CentOS 7 / RHEL 7:

sudo yum -y install wget
wget https://download.opensuse.org/repositories/shells:fish:release:3/RHEL_7/shells:fish:release:3.repo -O  fish.repo
sudo mv fish.repo /etc/yum.repos.d/
sudo yum install fish

Install Fish shell on Arch Linux / Manjaro:

sudo pacman -S fish

Install fish on macOS:

$  brew install fish

Configure Fish shell on Linux

After installation you can open your terminal and type below command to start using fish shell.

$ fish
Welcome to fish, the friendly interactive shell
Type `help` for instructions on how to use fish
[email protected] ~#

Enter exit to exit a fish shell:

$ exit

Set Fish as default shell for user

First add the fish shell /bin/fish to /etc/shells with:

echo /bin/fish | sudo tee -a /etc/shells

Then change your default shell to fish with the following command.

$ chsh -s /bin/fish
# For another user
$ sudo chsh -s /bin/fish <username>

Logout

$ exit

Login back and confirm active shell.

$ echo $SHELL
/usr/bin/fish

Your fish shell configurations files are located in the following directory

~/.config/fish

How To Uninstall Fish Shell

If you wish to uninstall fish, first ensure fish is not set as your shell. Run

chsh -s /bin/bash

Next, run install command that matched your Linux distribution to remove fish shell.

In our next article we will look at how you can configure Fish shell with Oh My Fish framework. Here are other guides that could be of interest to you.

Install Starship Shell prompt for Bash, Zsh, Fish and PowerShell

Install Alacritty Terminal Emulator on Linux, macOS and Windows

Free Books to Learn Linux Bash Scripting

LEAVE A REPLY

Please enter your comment!
Please enter your name here