How To Install, Configure And Use Fish Shell In Linux?
======
Every Linux administrator might heard the word called shell.
Do you know what is shell? Do you know what is the role for shell in Linux? How many shell is available in Linux?
A shell is a program that provides an interface between a user and kernel.
kernel is a heart of the Linux operating system that manage everything between user and operating system (OS).
Shell is available for all the users when they launch the terminal.
Once the terminal launched then user can run any commands which is available for him.
When shell completes the command execution then you will be getting the output on the terminal window.
Bash stands for Bourne Again Shell is the default shell which is running on most of the Linux distribution on today’s.
It’s very popular and has a lot of features. Today we are going to discuss about the fish shell.
### What Is Fish Shell?
[Fish][1] stands for friendly interactive shell, is a fully-equipped, smart and user-friendly command line shell for Linux which comes with some handy features that is not available in most of the shell.
The features are Autosuggestion, Sane Scripting, Man Page Completions, Web Based configuration and Glorious VGA Color. Are you curious to test it? if so, go ahead and install it by following the below installation steps.
### How To Install Fish Shell In Linux?
It’s very simple to install but it doesn’t available in most of the distributions except few. However, it can be easily installed by using the following [fish repository][2].
For **`Arch Linux`** based systems, use **[Pacman Command][3]** to install fish shell.
```
$ sudo pacman -S fish
```
For **`Ubuntu 16.04/18.04`** systems, use **[APT-GET Command][4]** or **[APT Command][5]** to install fish shell.
Once you have successfully installed the fish shell. Simply type `fish` on your terminal, which will automatically switch to the fish shell from your default bash shell.
```
$ fish
```
![][10]
### Auto Suggestions
When you type any commands in the fish shell, it will auto suggest a command in a light grey color after typing few letters.
![][11]
Once you got a suggestion then simple hit the `Left Arrow Mark` to complete it instead of typing the full command.
![][12]
Instantly you can access the previous history based on the command by pressing `Up Arrow Mark` after typing a few letters. It’s similar to bash shell `CTRL+r` option.
### Tab Completions
If you would like to see if there are any other possibilities for the given command then simple press the `Tab` button once after typing a few letters.
![][13]
Press the `Tab` button one more time to see the full lists.
![][14]
### Syntax highlighting
fish performs syntax highlighting, that you can see when you are typing any commands in the terminal. Invalid commands are colored by `RED color`.
![][15]
The same way valid commands are shown in a different color. Also, fish will underline valid file paths when you type and it doesn’t show the underline if the path is not valid.
![][16]
### Web based configuration
There is a cool feature is available in the fish shell, that allow us to set colors, prompt, functions, variables, history and bindings via web browser.
Run the following command on your terminal to start the web configuration interface. Simply press `Ctrl+c` to exit it.
```
$ fish_config
Web config started at 'file:///home/daygeek/.cache/fish/web_config-86ZF5P.html'. Hit enter to stop.
qt5ct: using qt5ct plugin
^C
Shutting down.
```
![][17]
### Man Page Completions
Other shells support programmable completions, but only fish generates them automatically by parsing your installed man pages.
To do so, run the below command.
```
$ fish_update_completions
Parsing man pages and writing completions to /home/daygeek/.local/share/fish/generated_completions/
3466 / 3466 : zramctl.8.gz
```
### How To Set Fish as default shell
If you would like to test the fish shell for some times then you can set the fish shell as your default shell instead of switching it every time.
If so, first get the fish shell location by using the below command.