How to Install Fish Shell on Debian 10
Servers on Vultr are deployed with the Bash shell by default. Fish (friendly interactive shell) is an alternate shell that tries to be more user-friendly and interactive than other shells. In this tutorial, we will install Fish on a Debian 10 Vultr instance.
Install Fish on a fully updated Debian 10 instance.
Install Fish with the following command.
$ sudo apt install fish -y
To start Fish:
To exit Fish:
Start with a default configuration file.
$ cp /usr/share/fish/config.fish ~/.config/fish
To change the configuration, open the configuration file with a text editor.
$ nano ~/.config/fish/config.fish
For example, to remove the default welcome message, add the following line at the beginning of the file.
set -g -x fish_greeting ''
How to Use Suggestions
Fish will suggest file names and commands as you type them. For instance, if you would like to edit the file in your home directory called
test.txt, you can type
nano ~/te, and Fish will preview the rest of the filename. Press the Right arrow key to accept the suggestion. Fish offers more complete suggestions than Bash because it indexes the man pages and gathers program arguments.
To set variables in Fish, use the
set command. For instance, to assign the variable
Foo the value
$ set Foo BAR
$ set -e Foo
Display all variables
env command to display all variables..
help command for online documentation.
Set the Default Shell
To make Fish your default shell, use
$ chsh -s /usr/bin/fish
Log out, and log back in for this to take effect.
To restore Bash as the default shell, use
chsh, log out, and log back in.
$ chsh -s /usr/bin/bash
For more information and configuration options, see the Fish shell documentation.