FISH Shell: A dynamic shell

There comes a time in every programmer/SysAdmin/computer geek's life when the terminal becomes our best friend and we spend most of our time looking at a screen with lots of text in it, using it to tell the computer what to do.

We depend so much in the terminal that we develop skills to tame that beast, subjugating it to our will, or at least that's what we would want to do, however more often than not we succumb to its ways and end up picking up certain habits to use this or that shell, some of us use KSH (really? In this day in age?), ZSH, the most commonly used BASH or another more obscure shell, I know I have!

But for some time now I have been in love with the FISH shell and now I use it everywhere I have access to a unix-like command line, this includes my servers, my laptop and even my cygwin configuration in my windows machine. The reason I use it is because it has become my swiss army knife of shell scripting because its ease of use and potential.

FISH Shell

Now, I will not talk broadly about what FISH is and it can do, that's what the FAQ is for, instead I will show you how to install it from source. Yes, there are precompiled packages ready for download and even some distributions ship FISH on their repositories, but how else can I link to my previous post about compiling stuff? :D

Let's get our hands dirty then, the first thing we need to do is download the source code from the official page:

user@computer: ~/Downloads $ wget

Next we need to navigate to the directory in which the package was uncompressed and compile it (provided that you have already downloaded the compiler and necessary tools):

user@computer: ~/Downloads $ cd fish-2.1.1/
user@computer: ~/Downloads $ ./configure
user@computer: ~/Downloads $ make
user@computer: ~/Downloads $ sudo make install

Ok, with this FISH has been installed in out system, but how do you use it?
You can always run the fish command from whichever shell you're running, or even setup your init script to automatically launch FISH on top of your shell, but that's not the ideal solution now, is it? Of course not!
The simplest and most effective way to switch your old shell for fish is using the chsh command like so:
user@computer: ~/Downloads $ chsh -s $(which fish)

With that, next time you login to your account you will be sent to FISH automatically.
Now you have installed fish, what's next? Start by reading the tutorial and getting to know the environment better, start by learning that command expansion (running a command on a subshell) is no longer $(command) but just (command) and that && and || are substituted by the more simpler and and or, also you would like to run the fish_config command, notice that it will open a nice browser page in which you can configure your FISH environment, if you want further customization without much hassle, take a look at the Oh my Fish project on github.

Don't forget to play around and get your hands dirty, after all that's the fun part of learning!

If you liked this don't forget to comment and share this.