Fish – A Smart and User-Friendly Interactive Shell for Linux

The Friendly Interactive Shell which is commonly called and abbreviated as FISH is a shell for UNIX and UNIX like Operating System. It is released under GNU General Public License v2.

Fish Shell for Linux

Fish Shell for Linux

FISH is a user-friendly, interactive shell designed to work with any other shell like bash or ZSH. It is designed in such a way that users get powerful features that is easy to discover, remember and use. Unlike other shell which disables various features by default to save system resource, FISH keeps all of them enabled by default so that you can make most out of it.

Features of FISH

  1. Interactive and User-friendly
  2. Powerful features
  3. Simple, clean and Consistent.
  4. Exotic in the sense that syntax not independent and isn’t derived from Bourne Shell or C shell.
  5. Search as you type feature ensures automatic suggestions based upon current directory and history.
  6. Select suggestions using arrow key.
  7. Advanced Tab completion supported.
  8. Syntactic rules prefer features as commands and not syntax.
  9. Help command to view FISH documentation in HTTP Web Browser.
  10. Support for Universal Variable so user can assign permanent variable, remains unaffected at reboot/shutdown.
  11. Syntax highlighting and extensive error checking.
  12. X clipboard supported.
  13. Glorious VGA Color. 256 terminal colors supported.
  14. Web-based configuration.

You can try fish in your web browser before installing it on your Linux systems.

Installation of FISH (Friendly Interactive Shell) in Linux

Fish packages can be installed on all Linux distributions using Fish repositories, the best way is to add the repository to your system package manager using the following steps as per your distributions:

Install Fish Shell On Debian

Add the following repository to Debian 9/8/7 and install manually as shown.

---------------- On Debian 9 ----------------
# echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_9.0/ /' > /etc/apt/sources.list.d/shells:fish:release:3.list
# apt-get update
# apt-get install fish
---------------- On Debian 8 ----------------
# echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_8.0/ /' > /etc/apt/sources.list.d/shells:fish:release:3.list
# apt-get update
# apt-get install fish
---------------- On Debian 7 ----------------
# echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/2/Debian_7.0/ /' > /etc/apt/sources.list.d/shells:fish:release:2.list
# apt-get update
# apt-get install fish

Install Fish Shell On Ubuntu and Linux Mint

On Ubuntu and Linux Mint (all supported releases) execute the following commands:

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

Install Fish Shell On Fedora

On Fedora run the following commands as root:

---------------- On Fedora 29 ----------------
# dnf config-manager --add-repo https://download.opensuse.org/repositories/shells:fish:release:3/Fedora_29/shells:fish:release:3.repo
# dnf install fish
---------------- On Fedora 28 ----------------
# dnf config-manager --add-repo https://download.opensuse.org/repositories/shells:fish:release:3/Fedora_28/shells:fish:release:3.repo
# dnf install fish
---------------- On Fedora 27 ----------------
# dnf config-manager --add-repo https://download.opensuse.org/repositories/shells:fish:release:2/Fedora_27/shells:fish:release:2.repo
# dnf install fish

Install Fish Shell On CentOS

On CentOS (7 and 6) run the following commands as root:

---------------- On CentOS 7 ----------------
# cd /etc/yum.repos.d/
# wget http://download.opensuse.org/repositories/shells:fish:release:2/CentOS_7/shells:fish:release:2.repo
# yum install fish
---------------- On CentOS 6 ----------------
# cd /etc/yum.repos.d/
# wget http://download.opensuse.org/repositories/shells:fish:release:2/CentOS_6/shells:fish:release:2.repo
# yum install fish

Install Fish Shell On RHEL

On RHEL (7 and 6) run the following commands as root:

---------------- On RHEL 7 ----------------
# cd /etc/yum.repos.d/
# wget http://download.opensuse.org/repositories/shells:fish:release:3/RHEL_7/shells:fish:release:3.repo
# yum install fish
---------------- On RHEL 6 ----------------
# cd /etc/yum.repos.d/
# wget http://download.opensuse.org/repositories/shells:fish:release:3/RedHat_RHEL-6/shells:fish:release:3.repo
# yum install fish

For Arch and Arch-based distributions, you can run pacman -S command to install fish.

How to Use Fish Shell

1. First time when you start fish, you should see this on the terminal:

$ fish

Start Fish Shell

2. Check version of fish installed.

$ echo $FISH_VERSION

Check Fish Version

3. See how auto-suggestion is working in FISH.

$ date
$ Desktop
$ locale
...

Fish Auto Suggestion

4. Call for help and you will get help in your default HTTP web browser.

$ help
Fish Shell Help

Fish Shell Help

5. Use Advanced Tab auto-completion followed by a incomplete string/command.

$ tty

Advance Auto Suggestion

6. Syntax highlighting as user type:

$ /usr/bin/calendar

Fish Syntax Highlighting

7. Intelligent color selection automatically in real time.

$ echo "I am loving FISH <3"

Fish Shell Color Selection

8. You can check exit status of last run command.

$ echo $status

Check Command Exit Status

9. Make FISH your default shell.

$ chsh -s /usr/bin/fish

Enter password when prompted.

Set Fish Shell Default

To switch back to your Previous shell do.

$ chsh -s /bin/bash

If any other shell was your default shell replace ‘/bin/bash’ with your shell. For example if it was zsh do:

$ chsh -s /bin/zsh

Caution: Check twice the path of your shell before entering. If you accidentally entered wrong path to a shell you will be thrown out of the shell, If you do this with your admin account, you will need to reset admin password and then change shell. To get rid of these hassles be extra-caution.

This shell provides output in a lucid and interactive way that it will change the way you look at Linux Shell. So much of colors, indention, highlighting of codes, auto-completion, suggestion and other features lets you concentrate on what you want to achieve and not how to achieve. This shell has been honored by being added as my default shell for my work machine. FISH is an example to those who says Linux command-line is boring.

If You are an avid Linux user and a fan of Linux command-line. This Shell is worth giving a try and it won’t disappoint you. You may like to share your experience with FISH in the comments below. Don’t forget to provide us with your valuable feedback in the comments below. Like and share us help us get spread.

Reference Link: http://fishshell.com/

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

11 Responses

  1. Gerardo Diez says:

    The point 8, check status of last run, is supposed that is an special feature of Fish? Because in bash is so simple as “echo $?”. It’s great that there are more tools, but I think that is more important to learn to use they.

    • Ravi Saive says:

      @Gerardo,

      No I don’t think so it’s special features of Fish, but I can say every tool has different way of achieving same results…

  2. Jakub Vaněk says:

    $ sudo add-apt-repository ppa:fish-shell/nightly-master
    $ sudo apt-get update
    $ sudo apt-get install python-software-properties
    $ sudo add-apt-repository ppa:fish-shell/nightly-master
    $ sudo apt-get update
    $ sudo apt-get install fish

    What? You don’t need python software properties at all and don’t need add the ppa twice. This one-liner is enough:
    sudo sh -c ‘add-apt-repository ppa:fish-shell/nightly-master && apt-get update && apt-get install fish’

    • Ravi Saive says:

      @Jakub,

      Thanks for your finding, yes we don’t need Python properties and also no need of adding twice PPA as shown in the article. As per you findings, we’ve updated the article..

  3. Derek says:

    Don’t forget to check Oh My Fish framework for a lot of nice plugins and prompt themes for Fish Shell:

    https://github.com/oh-my-fish/oh-my-fish

    • Ravi Saive says:

      @Derek,

      Thanks for sharing the tool with us, we will definitely have a look and if possible will add a small description about this tool in this article..

      Also is there any difference between Fish and Oh My Fish? could you elaborate more on this? if it’s difference than each other, better could you provide a article on this so that we can publish it under your name on TecMint..

  4. Aaron Kili K says:

    Thanx for the article and am already liking this Fish

  5. Ignacio says:

    Hi,

    Thanks for this great article.

    Pleas check the spelling.

    “If you does this” should say “If you do this”.

    Regards,
    Ignacio

  6. Virneto says:

    That would be dnf install on Fedora 22.

    I’ve already installed it. Sweet!!
    Thanks for this nice post!!

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

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