Enhance your terminal with fish

terminal-glossy.jpg

fish is a user friendly command line shell for UNIX-like operating systems such as Linux. fish supports syntax highlighting and generally makes reading a terminal, as well as text documents, much easier. I’ve included a screenshot example, but you can see the rest here.

fish4.png

The fish homepage tells you where you can download fish for your distribution. But to make things easy for the main three players we focus on here at TuxTraining.com

  • On Debian/Ubuntu: sudo apt-get install fish
  • On Fedora: (as root:) yum install fish
  • On openSuse (as root:) zypper in fish

fish works very much like the bash shell. You type the same commands as you would within bash. To switch shells on a one time basis simply type:

fish

This should bring you to a new prompt that says something like:

username@hostname-desktop:~$ fish
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish

To exit the fish shell and return to the bash shell, simply type “exit”.

If you would like to make fish your default shell, type:

chsh -s /usr/bin/fish

This should prompt you for the root password. Once you type that in, log out of the bash shell and back in, fish should be your default shell at this point. If you wish to undo this at any point, simply type

chsh -s /usr/bin/bash

You can see what shells are available for your system within the /etc/shells file. If you installed a shell but it is not in this file the “chsh -s” command will not work.

So lets say you installed fish from source, and fish is not listed in the /etc/shells file. You would first locate the binary like so:

locate fish

This might produce a long list of files, search for the one that corresponds to the shell itself. The path could be /usr/bin/fish or /usr/local/bin/fish, or a number of other places depending on your distribution. You would then edit the /etc/shells file and place that path at the bottom of that file. Then you would be able to chsh -s /usr/bin/fish to change your shell.

Simple enough? Enjoy your jazzed up terminal.

Related Posts

Comments are closed.