The sys admin's daily grind: Fish

Fishy Business

Article from Issue 161/2014
Author(s):

Columnist Charly serves up Fish as the "shellfish" of the day. His conclusion: tasty, but not something you would want every day.

The Friendly Interactive Shell (Fish) [1] is something that attentive readers of this magazine might recall from the "Tool Tips" series [2]. Since then, I've played around with it on a couple of my computers, and here's what I discovered. I immediately enjoyed the well-functioning prediction function. If part of a command is unclear, Fish highlights it in red (Figure  1). At the same time, the shell offers suggestions on how to proceed.

Figure 1: If part of a command is unclear, Fish highlights the start of the command in red.

History from Man Pages

Out of the box, Fish derives its recommendations from the history. If I enter the command fish_update_completions at the command line, Fish slogs its way through all the installed man pages – there are nearly 2,000 on my Ubuntu lab machine  – and builds a database (Figure  2). Fish then references them to find additional suggestions for autocompletion.

Figure 2: This command tells Fish to rummage through all the installed man pages and build a complete database.

On the project page [1], the authors may flirt with retro charm – "Finally, a command line shell for the 90s" – but there is much more to Fish than a green-on-black look. On the contrary, Fish is as colorful as the denizens of a coral reef. Commands, parameters, paths, special characters – everything has its own hue from a palette of 256 "glorious VGA" colors.

Of course, I could tune each color assignment at the command line, but you'd need to be a real ichthyophile to enjoy all that manual tuning work. Normal users would do better to navigate to lighter fishing grounds. The fish_config command, for example, starts a mini-web server on port 8000 and let you calibrate the colors – and much more – in a browser to suit your taste (Figure 3).

Figure 3: Users can select their Fish highlights from a plethora of colors in the browser.

Fish Dish

If you type help, you are again taken to a browser window where you can scroll through the very extensive documentation – or maybe not, if you are working on a server without X11. What I miss most is Ctrl+R, the full-text search in your own history. I use this function dozens of times a day, but not on Fish, where I just run into the aquarium wall every time I try to use the shortcut.

Because of this, and because full Bash syntax is missing for scripting, Fish is not a good choice of default shell, in my opinion. However, this denizen of the deep works well in its own habitat, thrills with its brilliant colors, and offers several very attractive features – all of them pearls that I would enjoy seeing in Bash.

Infos

  1. Fish: http://fishshell.com
  2. "Tool Tips" by Uwe Vollbracht, Linux Magazine, October 2013, pg. 30: http://www.linux-magazine.com/Issues/2013/155/Tool-Tips

The Author

Charly Kühnast is a Unix operating system administrator at the Data Center in Moers, Germany. His tasks include firewall and DMZ security and availability. He divides his leisure time into hot, wet, and eastern sectors, where he enjoys cooking, freshwater aquariums, and learning Japanese, respectively.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Command Line: Fish

    The fish shell provides many features that rival the well-known Bash. We examine some highlights.

  • Fish Shell

    The Fish shell offers some user-friendly features for command line beginners.

  • Charly's Column

    Commercial surveillance systems are expensive and typically involve maintenance agreements. I thought there must be a low-budget alternative.

  • Charly’s Column: Cluster SSH

    Charly doesn’t relish the idea of searching through the logfiles of a dozen proxy servers when page requests fail. Now that he has deployed Cluster SSH, he can pull the strings on many machines at the same time.

  • Charly's Column

    Parallel SSH is the name of an easy-to-configure tool that our resident sys admin, Charly, now routinely deploys whenever he needs to launch the same programs, copy the same files, or kill the same processes simultaneously on multiple computers.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News