fish(Friendly Interactive Shell)

fish(Friendly Interactive Shell) is a new shell for Linux. I tried it out and have decided to dump bash for fish. Try it out – you will come to the same conclusion as well.

Features of fish

Syntax Coloring

The shell colorizes the commands as you type them – if it is a valid command it will have a green color. For example, lets say I want to see my network interfaces. Recently, I had a lot of use for that – but that is another post. So, I type ifconfig into the shell. When I am at ‘ifco’, the shell will be like this…

Ifco - Typing completion

When I have completed the command, ifconfig, the shell will be like this…

Completed

Strings, matching etc. are also highlighted as you type.

Syntax Highlighting

Tab Completion

You would not think that this is a new feature. Bash has tab completion. Even Windows XP’s DOS terminal has tab completion. But fish’s tab completion is no ordinary tab completion – think of it as tab completion on steroids.

fish’s tab completion implements a feature that I really needed – tab completion for subcommands. Subcommand is the command line argument that is given to some programs. For example,

yum update gimp
cvs commit file.php

In the first example, yum is the command an ‘update‘ is the subcommand. Just type ‘yum upd’ and press Tab to complete the command. Similarly in the second case cvs is the command and commit is the subcommand.

Many other completions are also supported…

  • Commands, both builtins, functions and regular programs.
  • Environment variable names (Eg. $HOME).
  • Usernames for tilde(~) expansion.
  • Filenames, even on strings with wildcards such as ‘*’, ‘**’ and ‘?’.
  • Job id, job name and process names for process expansion. This is very useful when using kill.

Enough talking. You can download the fish shell from their official website. For Red Hat/Fedora Core users, this command will do the trick.

yum install fish

If you are a debian or Ubuntu user, use this command

apt-get install fish

5 comments

  1. The bash that is shipped in my ubuntu does all the completions that you pointed out in this article. I think this is not new to fish. On Debian|Ubuntu, there’s a file called /etc/bash_completion that does the job, helped with the files in the /etc/bash_completion.d/ directory (completions for subversion, django, paster, debconf, apache, openoffice etc.)

    Based on your overview, the only thing that it does is syntax coloring on the fly.

Leave a Reply

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