Getting Started with Fish
For ages I used bash
simply because its the default shell on most Linux distributions. Now that I'm exploring FreeBSD I thought to myself, why not also consider alternative shells?
I briefly used the FreeBSD default sh
, then spent a few weeks with oksh
(portable version of OpenBSD ksh
). Inspired by Julia Evan's "Reasons I still love the fish shell" I decided to give the aforementioned shell I try and took to it like a fish to water! wha wha wha 🐟
Install on FreeBSD:
# pkg install fish
Switch from the current shell to fish
by running:
$ chsh -s /usr/local/bin/fish
Exit the current session then log back in:
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
dwa@proxima ~>
In a graphical environment, the help
command opens the documentation in a browser:
dwa@proxima ~> help
help: Help is being displayed in xdg-open.
dwa@proxima ~>
Out-of-box the default behaviour of fish
was very much to my liking, especially its "smart autosuggestions" feature. Depending on what text you begin to enter at the command prompt, fish
begins making suggestions about what command you might want to run, which file you might want to work with, what location you might want to navigate to. I've quickly adapted to this workflow and find it useful!
To start customizing fish
, the fish_config
command will start a web server and open a browser window where a number of options can be modified. Of course, everything can be modified inside the terminal as well. User settings are stored in ~/.config/fish
and the command history can be found at ~/.local/share/fish/fish_history
.
The equivalent of ~/.bashrc
is ~/.config/fish/config.fish
and all the user customizations could be placed in this file, but I find it cleaner to spread the few changes I've made over multiple *.fish
files. My personal abbreviations (think alias
in bash
) and environmental variables I place inside ~/.config/fish/conf.d/ and bits of custom code are saved as functions
in ~/.config/fish/functions/.
Its my new default interactive shell. Highly recommend giving it a try!
You can like, share, or comment on this post on the Fediverse 💬
» Next: FreeBSD: After the First Boot
« Previous: Exploring FreeBSD on a Laptop