Discovering Fish Shell: The Linux friendly terminal

Introduction to Fish Shell

Fish Shell, whose name comes from «Friendly Interactive SHell», is a modern alternative to traditional shells like Bash or Zsh. Designed to be intuitive from the first use, Fish offers smart self-completed, real-time syntax highlighted and a configuration that does not require complex files. Its focus on usability has made it a popular option for both new users and system administrators who seek to improve their productivity in the command line.

Installation in Linux distributions

Install Fish is simple in most distributions. In Ubuntu and its derivatives just runsudo apt install fish. In Fedora it is usedsudo dnf install fishand in Arch Linuxsudo pacman -S fish. After installation, you can start Fish simply by writingfishat the current terminal. To establish it as a default shell, the command is usedchsh -s /usr/bin/fish. These steps allow you to start working with Fish without the need to compile source code or advanced configurations.

Main characteristics

Among the most outstanding features of Fish are the self-completed based on man's history and pages, the syntax highlighted that shows valid commands in green and the red errors, and the automatic suggestions that appear while written. In addition, Fish includes an accessible web configuration interface byfish_config, which allows to change themes, adjust colors and create abbreviations without editing configuration files manually. These functions are designed to reduce friction and accelerate daily workflow.

Self-completed and intelligent suggestions

The self-completed Fish goes beyond the simple match of prefixes. Analyzes the command context, available options and previous arguments to provide relevant suggestions. For example, when writinggit comFish will showcommitas a main option, while typingls -lpropose directory and file routes. The suggestions appear in the form of a small text to the right of the cursor and are accepted with the keyorCtrl + F. This behavior significantly reduces the need to memorize options and improves accuracy when writing long commands.

Configuration and customization

Fish stores its configuration in the directory~/.config/fish. The fileconfig.fishit runs every time a new session is started. Here you can define variables, create functions and load extensions. The commandfish_configopens a web browser with a graphic interface where you can change color themes, adjust self-completed behavior and create custom abbreviations. In addition, there are frameworks such asOh My FishandFisherwhich facilitate the installation of plugins and community themes, allowing for the adaptation of the specific workflow shell.

Scripts and functions in Fish

Although Fish uses a slightly different syntax to Bash, its scripts are equally powerful. The functions are defined by the keywordfunctionand end withend. For example, a simple function to show the date and time could be:

function ahora
    date "+%Y-%m-%d %H:%M:%S"
end

The variables in Fish are of local range by default and are manipulated withsetandset -gfor global variables. The loops and conditionals follow clear structures likefor, whileandif else end. This coherent syntax makes writing and maintenance of scripts less prone to errors than in more traditional shells.

Comparison with Bash and Zsh

Compared to Bash, Fish offers a more friendly experience from the first use, without the need for extensive configurations to get self-completed and highlighted syntax. Zsh, although highly configurable by frameworks like Oh My Zsh, requires a more pronounced learning curve to achieve a similar level of comfort. Fish, for its part, seeks to offer an experience «ready to use» which still allows you to deepen through your scripting language and your plugin system. In terms of compatibility, most POSIX scripts are run smoothly, although some settings may be necessary when depending on Bash specific features.

Conclusion

Fish Shell represents a significant evolution in how to interact with the Linux command line. Its focus on usability, combined with powerful self-completed and visual configuration features, makes it a valuable tool for both beginners and advanced users. By adopting Fish, users can reduce daily friction, increase accuracy when writing commands and enjoy a more pleasant and productive terminal environment. If you are looking for a modern alternative that improves your workflow without sacrificing power, Fish Shell deserves serious proof.

This work is under aCreative Commons License Attribution 4.0 International for Francesc Roig francesc @ vivaldi.net.

EnglishenEnglishEnglish