July 05, 2008

5 Reasons to Use CLI Over GUI

First, I must say that using CLI is not always faster, not necessarily. There are tasks which can be done faster and easier using some GUI application rather than typing a whole bunch of commands. But, nevertheless, command line is still very powerful and it's more appropriate to use it for certain tasks. I for one use probably 90% GUI tools and applications and only in 10% of the cases CLI. So, you may ask, what's the scope of this? Well, in the first place, this article is about the reasons I believe to be noteworthy for using CLI in several situations, and what advantages it has.

Some prefer GUI, others CLI, and others (including me) prefer both. In the future I'll probably make an article listing 10 reasons to use GUI over CLI, but until then, here are the main reasons I use my share of CLI applications.

1. Complete control over the system. This may vary. What I'm trying to say is that I got used to do some task using some CLI tools instead of a graphical application. Now using that application makes me wonder whether it will pass exactly the arguments I wanted to the command line tool or use some defaults which I don't want. Not once I saw a graphical application based on some CLI tool which only implemented half of its options, so I wasn't able to make it what I actually wanted.

2. Powerful for many tasks. CLI is often more powerful than GUI applications for specific tasks. For example, consider having a directory with hundreds of different file types in it. Moving, copying, eventually renaming them would be very hard in a GUI file browser. Selecting almost each of them with the mouse while pressing CTRL is not easy for such a big number of files and it also takes up more time. While on CLI, you can use one single command in order to perform whatever task and it's done.

3. Ability to use scripts. I have several small scripts in my ~/bin/ directory, which in Debian is detected and included by default in the $PATH. So I can run specific commands over some files in just one command and a parameter. This is very useful if you have some specific need or want a specific behaviour with some tool, which is not implemented in any graphical application.

4. Less memory. For whom it matters, using command line won't make the system load additional libraries which are not already loaded for some GUI application.

5. Ability to use aliases. Aliases are a great feature implemented by shell applications which allow a user to perform one or more commands using one simple, easy to write command, called an alias. The ability to use those often makes work easier.

Please share your advantages (if any) you may think of for using CLI whenever a GUI alternative is available.

Updated: Jul 05, 2008 (Created: Jul 05, 2008)

10 comments:

mehrshad moslehi -- vigol said...

1. How many time you forced to swtich to a CLI Sreen (During the failing of X start, or crashing X)
2. For some apps/utils like GCC (Frontend & Backend) is it possile to handle all options on a GUI ? maybe! but how do you find them?
2.1. A detailed Cource needed to understand what should I do, to do those I always do before (in CLI)
3. Practicing more and more in GUI --> Decrease the attractive of finding & Tracing some hidden feature in both OS and Utilities
3.1. Compare the ability of CC and Turbo C in the past years -- Which people'd knew More about abilities about their Compiler/Linker?
4. Addiction on GUI leading person to a situation that she or he don't know anything about some low level process
4.1. Result : Any many Task will encounter problem that waste she/he time to solve it (Crawling in books/forums/blogs/chats,... with less reslut)
5. Generally, Xs, WMs, DEs and as a whole GUIs arn't a entirely stable environments.
5.1. Sooner are later you'll find yourself in a text-based screen, and you'll must solved your problem there, By yourself!
6. I used to nearly all of my jobs with VI/VIM(V Improverd), From editing Config files (grub to apache, fstab to inittab,...) to coding and even more CGI/Web/Scrip Designing and Notes my Ideas or Memo.
6.1. All with one CLI utility, and it's set me free from engaging to learning dozen of IDE/RAD/GUI SDK and so on.
6.2. Result : Having More time to fiding and learning more detailed topics about system.

mehrshad moslehi --- vigol --- vigolyas

NotZed said...

It's almost always easier and faster to run a command to do something compared to finding it in a multi-level menu.

Not even taking account the time to get to the mouse in the first place.

Panels, 'menu panels', 'start menus' and all the rest are just searching for ways to make a gui more productive, since by default it just gets in the way. Cryptic icons, deep and/or huge menu's, lots of wasted screen space with 'launchers', every solution has a trade-off.

e.g. see a windows 'applications' menu (once you've installed some), vs a bash command line with a properly configured PATH - which is easier to find and run an application.

Wonderboy™ said...

Heh, this reminds me: I'm using nothing BUT a CLI for 30 days, not even X. I've learned alot about how Linux works just by doing that.

Anonymous said...

Didn't I just post something like this?

http://penguinpetes.com/b2evo/index.php?title=10_reasons_why_the_command_line_is_more&more=1&c=1&tb=1&pb=1

Anonymous said...

Whoops, that got eaten by a grue. Let's try again.

10 Reasons Why the Command Line is More User-Friendly than the Desktop

abose said...

Nice article, Dan. I was fearing one more CLI is the way to do everything, but that's exactly what you have avoided. Good job.

Vigol, just happened to read your last comment. Well, as much I like VI, the argument you have given applies to any good text editor (GUI or not). You can live your life having 'learnt' how to use Notepad++, or GEdit, or even Notepad, or Pico.

Important thing here is to see both sides of the coin. For certain jobs, command line is much superior, for certain you can get by either with command line or GUI, for certain other GUI is much superior. If you don't believe me, try elinks or w3m for a while instead of Firefox. If you still don't believe me, hat's off to ya :)

Craciun Dan said...

Thanks, abose, and by the way, nice blog you have there (seen it through your profile).

Anonymous said...

There should be a fine for littering in the blogosphere too.

This post does not add anything that's not found elsewhere.

Not that I don't admire CLI apps (have been using them for ages). But there's nothing in this post that could make me move to CLI :) Aliases? Cmon...

Do we need a thousand crappy blog posts about relative advantages of CLI over GUI? A tonne of well thought of articles are just a google search away.

Time we move on to some more interesting stuff...

Reya276 said...

@Chill,

I too need photoshop and illustrator to do my work as a web developer and graphic designer. But guess what those apps that you say Linux does not have is BS because I use GIMP and inkscape without a problem in fact I can do everything. Also with Wine I can run Flash Professional 8 which works just like in Windows, I think the issue here is your preference. So please stop criticizing Linux/Ubuntu because you chose not to use those tools already available. In terms of the video editing is the only thing lacking in Linux and I think even this is getting better, ever tried Cinelara or LIVES google that.

As far as FireFox hanging up on you, I think you have a hardware issue buddy, I run so many apps at once that if I were to ever try this on XP pro/Vista it will crash to the point I will have to press and hold the power button.

Good luck to you sir and your Windows OS, hah I and many others have rid ourselves of this virus/garbage a long time ago and it will stay that way!

blackbelt_jones said...

Nice article! I agree with everything but the title, because to my mind, it seems to reinforce the 1980's "cli vs. gui" mindset that people still can't get past. The GUI and CLI are not in competition anymore. The command line is part of the desktop. You can use it all the time if you want, just as you can use the gui all the time if you want, but I think people need to be more aware that the command line supplements the desktop, it's integrated with the desktop, and it's easy to move from one to the other.

I especially love that I can use Konqueror or Nautilus or Dolphin to click to a directory (or even bookmark it) and then open it in the terminal window. Usually, I prefer that to feeling my way in the dark with the cd command.

For me, it's not about one tool being better than another tool. It's about two tools being better than one tool.