Afraid of the command line interface? Try Fish!

Posted April 18th, 2009 by j00p34

Often I get ideas when working on a PC, ideas for things that would be nice to have on my system. Most of the time I sooner or later discover someone else had the same idea and build the thing I was thinking of only better.

Free

This is one of the most impressive things about Linux, and one of the things I most enjoy. I dream up something I would like to see and someone else has already built it and is giving it away for free.

Limited by fear

A lot of people tell me they are more or less afraid of using the command line. This cripples them a bit when they want to use Linux because the command line (shell) is the most powerful control tool in Linux.
The reason most people don't like using the command line is because they'll have to learn the commands before they can do anything. In a GUI interface you can just click on all the buttons and just see what happens. If you do something stupid you are most often warned about the consequences.

Learn the commands

Lately I was thinking:
"Wouldn't it be nice to have a shell environment that helps you to learn the commands?"
I was thinking of something like a shell which just displays the basic options you have, like build in commands.

Extra info

A little extra information for the people who don't know too much about the Linux command line:
The command line in Linux is actually a program like any other, it's called a shell because it actually shells around the operating system and it gives you an interface to work with. Consequence of the shell being nothing more than a program is that you can replace it with another shell or even start another shell from the shell and run programs from that one. This is what you do when you change to another user with su, you start a shell as another user and enter that shell. Their are many shells for linux and you can choose for yourself which one you like best. The standard shell in most linux operating systems is bash which is short for bourne again shell. There is a lot more to know about shell's but that is not what this article is about. The only thing important here is that you can easily enter a new shell by executing it from the command line:

$bash (enter)

and if you want to get out again you just type exit:

$exit (enter)

Fish

And what did I find by accident while looking for something completely different? A shell which shows you all options you have and has a lot more features which make it great for starting linux shell users.

It's called fish and you can easily install it in ubuntu from the universe repositories, use sudo apt-get install fish from the command line or just search for it in your package manager.

The fish website is here

Using it

To use it when it's installed just open a command shell and enter fish. The next moment you'll be in the fish shell and you can do everything you do on your normal shell and a lot more.
If you need help on how to use fish (or shells in general) you can just enter help and it will open a help document in your default browser on your desktop.

Help

The tab key gives you all commands available which is a rather extensive list. The help document contains information on even the most basic things like ls and cd. So if you still have to learn the basics and you keep forgeting the commands you only have to remember help from now on.

Some features

The use of fish is certainly not limited to learning to use the shell, it's a more user friendly version of the command line.

Some of it's features include:

built in help function by typing help.

advanced colors showing mistyped commands, when you type you see the text changing to green when a valid command is entered.

advanced tab completion feature showing a lot of options and program specific options. For instance when you type ls(tab) it shows all available ls options next to the option a summary of what the option does.
Typing man(tab) shows you the available manual sections.

helpful error messages which try to tell the user what they can do to fix the error.

changing directories by just tying the path without cd.

Directory history like pushd and popd but being used automatically when changing directories.
So when you navigated trough many directories you can just go back and forth with nextd and prevd commands.

Great for starting users

It's a very nice project and I will certainly advise starting users to use it to help them learn the Linux commands. I can only think of one reason for not using it, and this is also the reason why I won't be using it as my default shell: If you have to use the command line professionally it might not be available on all systems you work on, as it is currently only available in limited systems. It is in debian testing but I wouldn't be able to use it on many servers I get on. I don't want to get used to features like changing directories without cd because I would get very frustrated changing to another method all the time. If your not in such a situation I can't see any reason for not using it. I would at least give it a try, even if it's just for fun. This shell is fun to use for everyone.


Great!

Anonymous 2 years 10 weeks 15 hours 24 min ago

I just switched from Bash to Zsh and got to think about that user firendly distributions like Ubuntu really should provide something like Fish as default for the user-accounts with Bash as an option. I find it ...fishy... that all distros out there are running Bash as CLI whereas there are so much variants on the GUI front. Seriously for power users I would recommend Zsh and for beginners Fish any day!

Nice article

Anonymous 3 years 13 weeks 5 hours 36 min ago

Nice article.

A user-friendly CLI is way overdue. However, there are lots of scripts for BASH all over the place. A user-friendly shell that runs BASH scripts would be preferable.

If bash is installed and the

Anonymous 3 years 12 weeks 6 days 9 hours ago

If bash is installed and the script is in a file then you can still run bash scripts.
Make sure the file is executable: chmod +x file.sh
Make sure the first line is : #!/bin/bash ( or whatever the path to bash is... )
You can have your cake and eat it too!