Pinterest Stumbleupon Whatsapp
Ads by Google

Perhaps what drives so many people to install Linux is that it’s so ridiculously customizable. If you don’t like how it looks, you can just install a new windowing environment It's Your Choice: The Top 10 Linux Desktop Environments It's Your Choice: The Top 10 Linux Desktop Environments From Gnome to KDE, from MATE to Unity, there's a lot of choice out there. Where should you start? Overwhelmed? Start here. Read More . If you don’t like how your terminal works, you can change that by installing a new shell.

There are a lot of different shells you can choose from. One of the most popular is bash, but there’s also ZSH, Korn Shell, and TCSH. They are all fine shells, but they were all created in the 1970s, 1980s, and early 1990s, and they haven’t really moved with the times. Which is why you should consider trying fish – the Friendly Shell.

Fish has the slightly ironic tagline of “a command line shell for the 90s”. It introduces features that really should have became commonplace sooner, but didn’t. Features like autosuggestions, VGA colors, and a scripting language inspired by modern programming languages like Python and Ruby. I’m a fan.

Read on to find out what fish can do for you, and how you can install it on your machine.

Autocomplete and Suggestions

One of fish’s best features is autocompletion. It knows what you’re thinking, and will gladly save you the keystrokes by finishing your command for you. Just press Tab.

Although it’s an innovative feature, at least as far as terminal shells go, it’s not all that complicated. It makes its assumptions based upon a combination of guesswork, and your command line history.

Ads by Google

AutoSuggestions

If you get stuck on a given command, pressing the Tab key will list all known acceptable parameters, and what they do. This is done by fish gleaning through the “Man Pages” (documentation, essentially) of that particular program.

TabSuggestions

Syntax Highlighting and Beautiful Colors

I know; you can customize other shells to use more vibrant colors, and to have syntax highlighting. But fish has it right out of the box, and has a much broader palette of shades to choose from.

Not only does this make things much more readable, but it looks really pretty. In my own experience, I’ve found this has markedly improved my accuracy on the timeline, as I’m less inclined to write malformed commands.

Wildcards

Another cool feature that fish has is the ability to use wildcards anywhere you feel like. So, how does that work?

Well, if you’re using Bash, and you run “ls *.txt”, you’ll get an error message because it’s looking for a specific file called “*.txt”. Not in fish.

WildCard

As you might expect, it’ll list everything in the given directory that has a file extension of “.txt”.

You can also have multiple wildcards too. So, if you run “ls *.jp*”, you will list every file that has an extension that starts with “.jp”. That’s extremely helpful when you consider that JPEG files can come with both “.jpg” and “.jpeg” extensions.

Web Interface

Another novel feature of fish is that it can be configured through a web interface, running on a local web server. This is pretty much the only shell that offers this. While this sounds like a bit of a “white elephant” feature, it really isn’t.

The web interface allows you to adjust the color scheme to your liking. Although, I must admit, I was pretty happy with the default palette.

WebConfig

Fish’s web configuration tool also lets you browse your environment variables What Are Environment Variables & How Can I Use Them? [Windows] What Are Environment Variables & How Can I Use Them? [Windows] Every now and then I'll learn a little tip that makes me think "well, if I known that a year ago then it'd have saved me hours of time". I vividly remember learning how to... Read More , all through the comfort of your own web browser.

Variables

Other things that can be adjusted through the web configuration tool are the terminal key bindings, the aesthetic of the command prompt, and the default functions available through Fish’s scripting language.

Prompt

Finally, you can also see your command line history. This is extremely helpful when you need to walk through the steps you took in order to solve a head-scratchingly difficult problem.

History

Flow Control

Let’s touch on another advantage of fish. Much like you can in bash, fishlets you use semicolons and combiners to chain commands together. This lets you have some kind of rudimentary flow control when you’re writing handy little one-liners.

Flow

The difference is that fish looks good while doing it. It replaces the logical operators Become Better At Finding Stuff With Search Engines: Boolean Search Logic Explained Become Better At Finding Stuff With Search Engines: Boolean Search Logic Explained It only takes Google's thousands of servers half a second to query approximately 50 billion indexed pages, it takes you significantly longer to scan only the first page of search results. On top of that,... Read More used by bash ( “||”, “&&”, and “!”), and replaces them with “and”, “or”, and “not”. This makes it way more readable.

Helpful Error Messages

This is my favorite feature of fish. Whenever you (inevitably) screw up, fish will explain in plain-English where you went wrong, and more importantly, how you can fix it.

ErrorMessages

I don’t know of any other shell that has error messages that are as clear.

It’s Easy to Install Fish

Convinced? I thought so. Now we’ll get to the part where I explain how to install it.

First, you’re going to need to grab a copy from fish from the repositories of your chosen Linux or BSD distribution. On Ubuntu and Ubuntu-like distributions, that’s just “sudo apt-get install fish”.

installfish

If you’re on a Mac, you can install it through HomeBrew Install Mac Software From Terminal With Homebrew Install Mac Software From Terminal With Homebrew Install (almost) any free Mac app by typing four words and hitting "Enter". Read More . It’s worth noting that if you’ve recently upgraded to El Capitan, HomeBrew might be broken. You can follow these steps to fix it. Also, if you’re using Windows, there’s a version for Cygwin.

You can immediately start using fish by typing “fish” into your command prompt and pressing return. The problem is, it’ll only be active for that particular session. If you close your terminal and reopen it, it’ll display the shell you used previously. That’s probably bash.

So, you need to set fish as the default shell. To do that, just run “chsh -s /usr/bin/fish”, and restart your terminal. If you run into any trouble, this AskUbuntu thread is especially enlightening.

ChangeShell

When I tried to install it on my Mac, I got an error that said “non-standard shell”. I was able to fix this by editing /etc/shells/ using the VIM text editor The Top 7 Reasons To Give The Vim Text Editor A Chance The Top 7 Reasons To Give The Vim Text Editor A Chance For years, I've tried one text editor after another. You name it, I tried it. I used each and every one of these editors for over two months as my primary day-to-day editor. Somehow, I... Read More , and adding the path to fish on a new line.

Swimming With The Fishes

Has fish tempted you to change your shell? Are you going to stick with plain-old bash? Or do you use some other kind of exotic shell? Let me know in the comments section below!

  1. daniyal141
    August 26, 2016 at 3:16 pm

    "Well, if you’re using Bash, and you run “ls *.txt”, you’ll get an error message because it’s looking for a specific file called “*.txt”."
    Does that really happen? I know almost all of MUO uses Ubuntu, but that never happened on Debian's bash, or even the bash I compiled and installed. If that does happen, I'll make it one of my reasons not to use Ubuntu.

  2. Charles R. Tersteeg
    August 2, 2016 at 3:02 pm

    I like fish in some ways.

    My vanilla zsh shows more when I tab

    Example
    git rebase

    Shows all the commits and fish just shows master etc.

    Fish also doesn't show all the branches in
    git branch

    I'm not doing something right as fish is just suppose to work.

  3. Jorge Bucaran
    March 31, 2016 at 10:41 am

    I am surprised there is no mention of its plugin manager, Fisherman, for complete hipstery.

    • omf
      April 24, 2016 at 7:19 am

      did you ironically bash on your own project while also ironically promoting it? new level of lowness... also 'its' plugin manager isn't just fisherman as you well know...

  4. a user
    March 1, 2016 at 7:45 pm

    @calculon ~> help
    Error: no display specified
    Couldn't find a suitable web browser!
    Set the BROWSER environment variable to your desired browser.
    Warning: program returned non-zero exit code #1
    Opening "/usr/share/doc/fish/index.html" with Browser (text/html)
    QXcbConnection: Could not connect to display
    Aborted (core dumped)
    /usr/bin/xdg-open: 461: /usr/bin/xdg-open: links2: not found
    /usr/bin/xdg-open: 461: /usr/bin/xdg-open: links: not found
    /usr/bin/xdg-open: 461: /usr/bin/xdg-open: lynx: not found
    /usr/bin/xdg-open: 461: /usr/bin/xdg-open: w3m: not found
    xdg-open: no method available for opening 'file:///usr/share/doc/fish/index.html'

    Not much use on a headless machine... :-(

  5. Alexandru
    March 1, 2016 at 7:32 am

    First (already remarked): In Bash the command "ls *.txt" will show all the files wich terminate with ".txt" without complaining about missing "*.txt" file.

    Second: Reading this article I see absolutely no advantage of Fish over Bash, all the goodies are available and in most cases (Linux Mint) are defaults.

    Third: Some completions depend on other techniques. Think of the following command:
    > apt-get install xserver-xorg-
    The average Linux distribution (Linux Mint comes in mind) is able of completing the available package name. Is it also possible with Fish?

    • EPadronU
      March 3, 2016 at 1:55 am

      Yes. Fish can autocomplete the name of a package after a `apt-get install` command or the equivalent in other distros (e.g. `pacman -S`).

    • Joviano Dias
      July 1, 2016 at 10:06 am

      I've used fish 2 months now. I was a bash lover too.. but fish seems the real deal.. i cant do bash no more.
      The only disadvantage would be bash specific syntax does not work in fish

  6. johng
    February 28, 2016 at 2:15 pm

    Autocomplete is not handled with the Tab key. Tab brings up the suggested commands. Right arrow will autocomplete a partially typed command.

    • Matthew Hughes
      February 29, 2016 at 9:10 pm

      Good catch!

  7. DeMus
    February 27, 2016 at 6:30 pm

    Well, the shiny colors might be nice for some people, for the rest there is not that much difference to make me install it.
    The TAB function to autocomplete is something bash knows, using wildcards is something bash knows, and using all these "fancy" colors is not what I am looking for.
    I think it is overrated and I won't be installing it.

    • Matthew Hughes
      February 29, 2016 at 9:11 pm

      Sorry, I meant right-arrow to complete a partially completed command! But yeah, try it. You might think it's overrated, but it's actually pretty good.

    • Joviano Dias
      July 1, 2016 at 10:07 am

      Not overrated. I recently switched. Took about a couple of days. It's awesome

  8. fcd76218
    February 27, 2016 at 4:48 pm

    There is a price to be paid for eye candy and glitz, performance.

    • Matthew Hughes
      February 29, 2016 at 9:12 pm

      I've not had any performance issues with it!

    • Yann
      February 29, 2016 at 11:14 pm

      You'd be surprised. It performs better than *vanilla* zsh (when its featureset is comparable to oh-my-zsh or prezto), and that is *with* all the goodies turned on.

  9. Bill
    February 27, 2016 at 1:42 pm

    I stopped reading at the following statement:

    "Well, if you’re using Bash, and you run “ls *.txt”, you’ll get an error message because it’s looking for a specific file called “*.txt”."

    Seriously, you need to fix that.

    • Oli
      February 27, 2016 at 5:57 pm

      I was surprised, why he could say that and done some testing.
      If there is no file ending with 'txt' in the working directory, in Bash you get the error "No such file...", but in fish it list all files. Now I am more surprised. May be some one can say why list 'ls *txt' in fish all files if no filepattern matches?

    • Matthew Hughes
      February 29, 2016 at 9:11 pm

      Good catch! That was a typo.

  10. stefomitev
    February 27, 2016 at 9:19 am

    It looks nice, will try it definitely. Thanks!

    • Matthew Hughes
      February 29, 2016 at 9:12 pm

      Let me know how you get on!

      • stefomitev
        February 29, 2016 at 10:38 pm

        Heya, like it very much. It would be nice if I can define env. vars in the web app for configuring! :)

  11. Jaden Peterson
    February 27, 2016 at 1:05 am

    Is it a fork of bash?

    • Jorge Bucaran
      February 27, 2016 at 5:41 am

      No, it is not :)

    • Matthew Hughes
      February 29, 2016 at 9:12 pm

      Nope! It's a competing shell.

  12. Brian Tkatch
    February 26, 2016 at 10:08 pm

    Nice. I might actually try it out.

    • Matthew Hughes
      February 29, 2016 at 9:12 pm

      Let me know how you like it!

      • Brian Tkatch
        March 28, 2016 at 3:06 am

        Very nice features, though not as intuitive as i'd like. Where i expect to use tab, it wants the arrow. It's makes suggestions, but i'm not always sure how to choose it.

        fwiw, i'm using it on a development laptop, but don't need it to much, so, i have little practice with it. The suggestions are perhaps fun, but just as annoying because i have to think about what to do. Perhaps it's just an issue of familiarity. But, i feel as if i would like to have the added feature when i want them, but not by default.

        In any case, it's is a pretty cool shell, even if i end up not liking it.

Leave a Reply

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