How do I set fish as the default shell instead of Bash in Elementary OS Terminal ?
What is Bash ? ๐
The Bash (Bourne Again SHell) is a popular command-line interpreter for interacting with the operating system, widely used in Linux and macOS environments. It is a powerful shell that allows users to execute commands, launch programs, and perform tasks by typing text commands.
Beyond interactive use, Bash is also a robust scripting language, enabling users to automate complex sequences of commands, create utility programs, and manage system operations efficiently through shell scripts. It is the default shell for many Unix-like systems such as Elementary OS, serving as the fundamental interface for system administration and general command-line work.
What is Fish ? ๐
The Friendly Interactive Shell, or Fish, is a modern Unix-like command-line shell focused on usability and interactivity, differentiating itself from traditional shells like Bash by being feature-rich right out of the box with virtually no required configuration.
Key features include powerful, context-aware autosuggestions based on history and completions, extensive syntax highlighting with error checking, and a simpler, more consistent scripting language that intentionally does not adhere to the POSIX standard for increased clarity. While its non-POSIX compliance makes its scripts less portable than Bash scripts, Fish is highly valued by many users for its superior interactive experience and ease of use in daily command-line work.
Why Fish instead of Bash ? ๐
Some users prefer Fish (Friendly Interactive Shell) over Bash for several key reasons, primarily centered on enhanced interactive features and usability:
Autosuggestions Out of the Box ๐
Fish provides intelligent, inline suggestions as the user types, based on command history and directory contents, which can be accepted instantly, dramatically increasing speed and reducing typing.
Syntax Highlighting ๐
It offers instant syntax highlighting that visually flags commands and arguments as correct or incorrect, making it easier to spot errors before execution.
Simplified Scripting ๐
Fish’s scripting language is designed to be cleaner and more consistent than Bash, using commands (like set
for variable assignment) instead of special syntax, making scripts easier to read and write.
Feature-Rich Defaults ๐
Fish is highly functional immediately after installation, offering powerful tab completion, command-line help, and features that require extensive, complex configuration or third-party frameworks in Bash (like Oh My Bash).
Universal Variables ๐
It supports “universal variables” that are instantly shared and persisted across all running Fish shell sessions and reboots, simplifying environment management.
Fish instead of Bash ๐
To make Fish the default shell in Elementary OS Terminal, watch this YouTube short video :
or follow these steps:
Install Fish ๐
If Fish is not already installed, open your terminal and install it using the following command:
sudo apt install fish
Change Default Shell ๐
Use the chsh command to change your default shell to Fish.
chsh -s "$(which fish)"
You will be prompted to enter your password.
If you encounter a message saying something like:
chsh: /usr/bin/fish: non-standard shell
or similar error with non-standard shell
message.
You need to add fish to the list of standard shells first.
Add Fish to standard shells ๐
Ensure the path to the Fish executable is listed in /etc/shells
. using this command:
sudo cat /etc/shells
You can find the path of Fish shell executable using:
which fish
If the path to Fish shell is not present in /etc/shells
, add Fish into /etc/shells
using this command:
echo "$(which fish)" | sudo tee -a /etc/shells
Log Out and Log In ๐
For the changes to take effect, you must log out of your current session and then log back in.
After logging back in, your Elementary OS Terminal will open with Fish as the default shell.
How do you set it back? ๐
In terminal, run this command inside Fish shell to set Bash as the standard shell again:
chsh -s (which bash)
I hope you enjoyed reading this post as much as I enjoyed writing it. If you know a person who can benefit from this information, send them a link of this post. If you want to get notified about new posts, follow me on YouTube , Twitter (x) , LinkedIn , and GitHub .