Fish shell, often referred to as βi shell,β is a modern alternative to default shells like Bash or Zsh. Although Bash has been the standard for years, Fish offers features that make it easier to use and more efficient. Here are some reasons why Fish shell might be a better choice for you. π
Why Switch from Bash to Fish Shell?
As an active Linux user, I used Bash for years. However, some time ago, I tried Fish shell and never looked back. The main reason? The advanced features offered by Fish Shell, such as:
Better Autocomplete: Fish has a smarter autocomplete system, not only recommending file or directory names but also relevant command parameters based on the
man
page. For example, if you typels -
and press the Tab key, Fish will display a list of possible parameters with explanations. πMore Attractive Display: With clear coloring for different types of files and commands, Fish makes it easier to distinguish between regular files, directories, and owned files (e.g., .txt, .pdf, or .zip files). π¨
Easier Configuration: Fish has a simple web interface that allows you to change themes, colors, and other options with just a few clicks. This is a perfect solution for those who donβt like feeling overwhelmed by complicated configuration files. π₯οΈ
Smoother Navigation: Fish has a smarter
cd
command, recording the history of directories youβve visited, so you can use thecd -1
orcd -2
commands to quickly return to previous directories. πSupport for Plugins: Fish has a strong plugin ecosystem, allowing you to add additional features such as code editing, integration with the
man
page, or even more attractive themes for your prompt. π
Why Not Choose Zsh?
I also tried Zsh, but there are several reasons why I prefer Fish:
- Complicated Configuration: Zsh can be difficult to configure themes, plugins, or even add simple options. I often felt overwhelmed by the number of configuration files that needed to be edited. π
- Plugin Issues: Some plugins in Zsh are quite finicky, especially when I had to change or remove them. Sometimes, changing one plugin could cause unexpected issues. π΅
In addition, Fish shell not only avoids these specific problems but also provides many features that are ready to use. π
Standout Features of Fish Shell
Fish shell offers several features that will surely delight users:
Smart Autocompletion:
- If you type
ls -
and press Tab, Fish will display a list of parameters such as-l
,-a
,-r
with explanations. - Fish also remembers your command history, so you can easily reuse previous commands.
Example:
ls -<press tab>
Fish will display:
ls -a # show all files including hidden ones ls -l # show file details ls -r # sort in reverse order
- If you type
Attractive Display:
- Fish automatically colors different types of files, making it easier to read the output of commands like
ls
. - Fishβs prompt also has themes that can be changed through the web interface.
Example:
ls
The output will look like this:
file.txt (blue) folder/ (green) image.png (purple)
- Fish automatically colors different types of files, making it easier to read the output of commands like
Flexible Configuration:
- You can open Fishβs configuration through the web interface by typing
fish_config
. - Fishβs configuration is located at
~/.config/fish/config.fish
, which can be customized as needed.
- You can open Fishβs configuration through the web interface by typing
Support for Plugins:
- Fish has plugin managers like
fisher
andomf
that allow you to easily add extra features. - Popular plugins include
bobthefish
(for themes) andz
(for quick directory navigation).
- Fish has plugin managers like
Installing Fish Shell
Installing Fish Shell is very easy and available on almost all Linux distributions. Here are the steps:
For Debian-based distributions (like Ubuntu):
sudo apt update sudo apt install fish
For Arch Linux-based distributions:
sudo pacman -S fish
Once the installation is complete, you can open Fish by typing:
fish
To check the version of Fish installed, type:
fish --version
Making Fish the Default Shell
If you like Fish and want to make it your default shell, follow these steps:
Open the
/etc/shells
file with a text editor:sudo nano /etc/shells
Add the following line at the end of the file:
/usr/bin/fish
Change your default shell:
chsh -s /usr/bin/fish
After logging out and logging back in, Fish will be your default shell. π
Using Plugins
Fish has a strong plugin ecosystem, and you can use fisher
or omf
to manage plugins. Here is how to install them:
Using
fisher
:curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
Using
omf
:curl -L https://get.oh-my.fish | fish
Once the installation is complete, you can install plugins with the command:
fisher install <plugin-name>
Popular plugins include:
bobthefish
for more attractive themes.z
for quick directory navigation.nvm.fish
for managing Node.js and Npm.
POSIX Compatibility
Fish is not a POSIX-compliant shell, which means commands written for Fish will not run in other shells like Bash or Zsh. However, this is not a big issue because Fish is designed to provide a better experience when working in an interactive shell environment. π
Conclusion
Fish shell combines powerful features with a user-friendly design, making it an ideal choice for anyone looking for a modern alternative to Bash or Zsh. With smart autocomplete, attractive display, and easy configuration, Fish shell will surely make you more productive in the terminal. So, try Fish shell now and feel the difference! π
For more information, visit the official Fish shell website at fishshell.com or explore the community on GitHub.
I hope this article helps you get to know Fish shell better! π