friendly interactive shell = fish
fish is a smart and user-friendly command line
shell for macOS, Linux, and the rest of the family.
Ranked in these QuestionsQuestion Ranking
Pro Auto suggestions
fish suggests commands as you type, based on command history, completions, and valid file paths. As you type commands, you will see a completion offered after the cursor, in a muted gray color (which can be changed with the fish_color_autosuggestion variable).
Pro Already set up for you
While other shells require a lot of set up to act the way you want them to and to have some useful features, fish works perfectly out of the box. It has all the most widely used features baked in and are there out of the box without having the need to install plugins or tweak any configuration files.
Pro Universal variables
You can define Universal variables, which are shared instantaneously through all running fish sessions and persists through shell restarts.
Pro High portability
Because it needs very little configuration to work properly, you can use Fish everywhere. If you are working on a system you don't usually work, installing Fish from the repository is easy and will give you the same experience as the installation on your own machine without having to drag a dotfile around.
Pro Excellent documentation
It has a great tutorial. And the official documentation is clear, full of eloquent examples, and to the point.
Pro Fisherman ⚑ A fast, modern plugin manager for fish
Large test coverage, micro-second shell start, compatibility with plugins from other existing frameworks such as Tackle, Oh My Fish and Wahoo, cache system, offline index, the Fishery and other features.
Pro Less ambiguent lists
Here is a sample. Notice that there are 2 files with spaces in names. ls produces a valid list, and for loop correctly iterated through its values.
➤ for a in (ls); ls -l $a; end -rw-rw-r-- 1 sashka sashka 0 Apr 19 03:16 alma mater.txt -rw-rw-r-- 1 sashka sashka 0 Apr 19 03:16 whatever i want.txt
sh scripts tend to be fragile when there are lists containing values with spaces.
➤ echo $PATH /usr/bin /bin /usr/sbin /sbin /usr/local/bin ➤ echo $PATH /usr/bin ➤ echo $PATH[-1] /usr/local/bin
Pro Intuitive shell expansion in "for" loops
Unlike bash, this won't return you string *.sh if no .sh files are found
for filename in *.sh echo "$filename" end
Pro Auto indentation when creating functions
When writing functions in an interactive shell, it will auto-indent as needed for if, for, function, etc.
Pro Interactive searchable history
Fish has by far the best way to work with history, everything is automatically searchable. It works in the way you expect. No learning required.
Pro Configuration framework for fish shell
Fish community maintains Oh My Fish, which is a shell framework inspired on Oh My Zsh awesome design and name. It offer a lot of beautiful prompt themes and awesome plugins, is lightweight, awesome and very simple to use.
Con Not POSIX compliant
Although fish tries not to break POSIX compatibility without a good reason, and despite efforts to implement a compatibility mechanism, you can face some issues if POSIX compatibility is expected/required.
Though, enthusiasts fix these cases. For example, add
in your .vimrc to solve the issue for vim.
Con Very slow
Much of the functionality in Fish was not written with performance in mind.
Con No support for sudo ! !
Fish has no support for
sudo !!, but you can use Oh My Fish shell framework and install
bang-bang plugin to have this shortcut in Fish shell. The downside of using bang-bang is that it takes over ones default key bindings, for those that don't use them it should not be an issue but for those that do it is an annoyance to be considered.
This can also be achieved by making this custom function:
function sudo if test "$argv" = !! eval command sudo $history else command sudo $argv end end
Con No undo support
There is no included undo feature currently.