Monday, 27 April 2009

Pros and Cons for Using CLI

In this article I will debate on several major advantages and disadvantages for using the command-line in Linux. When I think it's 'better' to use CLI, when not, and how can this can impact the work speed.

The pros

It's faster: It's well-known that in most cases the use of command-line is faster and makes easier working with large numbers of files
Easily automate tasks through scripts: Scripts and functions can prove very handy for certain tasks which need to be performed on a regular basis
Aliases: A strong point of the shell is the ability to create aliases, which usually replace a longer command (or small group of commands) with an easy to type one
More powerful: In most cases CLI is more powerful. Just an example, when it comes to manipulating a big number of files CLI is the way to go, since it can perform custom operations using several commands which usually fit on a single line very fast
Faster for getting help: It's faster to get help by copying and pasting a command (given that you know what it does) than through screenshots; bandwidth is one factor, another one is different desktop environments (e.g. use Synaptic/KPackage, go there, under that button, press that etc, instead of just apt-get install something)
Less memory: Using CLI won't load additional GUI libraries (given they aren't already loaded)
Less bandwidth: Although today bandwidth is not a major factor any more, using CLI for navigating on the Internet saves bandwidth and is faster
Basic CLI knowledge can make wonders: CLI can be successfully used on a very old computer, and you can browse the web, listen to music, use IRC and IM, read mail etc without any problems. A minimum CLI knowledge will also help troubleshooting a computer for which X won't start etc
GUI frontends can be incomplete: With CLI, you have complete power over the parameters to pass to a command-line tool. Sometimes GUI frontends lack those

The cons

Making mistakes: Running commands and scripts in a wrong manner (especially if one doesn't know what the specific command does) can lead to unwanted removal of files, a broken system and so on
Lack of GUI: Although you can browse the web, see images and even videos (using ASCII), it's obviously using CLI for that isn't the optimum way. Of course, this also depends on one's needs, but browsing the web for example with a text-based browser is usually slower and lacks images, videos etc.
GUI is definitely more intuitive: And also, more easy to remember things. Since the brain memorizes images too, GUI will be easier to use for the average user
GUI looks good: I guess it's always nicer to look at KDE4 effects or Compiz than at a screen full of text

Now I won't be hypocritical: I think over 95% of the Linux users have a GUI, and although one can use a computer only with CLI, it makes no sense to use only CLI if you also need to do tasks which require a GUI.


Anonymous said...

Use K3b, colours, errors coloured.

Use cdrecord/growisofs,
no coulors and no errors,
if you know what you do.

Anonymous said...

This post can be summarized as: CLI is powerful vs GUI is pretty. So, what is the point?

Anonymous said...

The point?

... Use both of them and live happy? :)

Anonymous said...

What about BashBurn? Run's on the console, easy to use, relatively nice interface (as far as text goes) and gets the job done.

m said...

Sometimes a pair of pliers is a perfect tool for a job, other times a hex wrench is the better solution. Sometimes the best solution depend upon the enduser. Battling this one back and forth only serves the interests of the evil one M$.

Anonymous said...

M's got it "all in", to the point of perfection. Word !

NotZed said...

GUIs are not universally 'more intuitive' than CLIs. In-fact, many fall well short, and the flexibility a GUI allows means there is more chances to make a mess of it. Since CLI's have fewer ways to implement things, they also have less to learn, and they can often be more intuitive as a result.

Of course, you don't use a cross-cut saw to drill a hole either, so it is also a matter of using the right tool for the job. It's as hard to browse a hyper-linked document using a CLI as it is to selectively copy and delete matching files using a GUI.

I think you were trying to point out the CLI shouldn't be dismissed as unecessary, and I agree wholeheartedly with that. I couldn't live without a CLI and don't use any graphical 'shell' interfaces unless forced to.