
There are many topics that tend to come up in a recurring manner around water coolers throughout the Linux blogosphere, and not just the great “Year of” debate, either.
No indeed, another shining example more than a little familiar to most of us who spend any time here is the much-abused command line — specifically, whether it’s outlived its usefulness in this era of the GUI.
Well guess what? The debate is back!
‘A Crusty Old Relic?’
That’s right — “Is the command line a crusty old relic?” was the name of the Open Ballot posted recently by the excellent team over at TuxRadar, and the conversation hasn’t died down since.
So what shall it be? Has the command line interface outlived its usefulness? Or is there still a place for this trusty old tool?
Linux bloggers haven’t held back expressing their opinions.
‘More Power and Versatility’
“The Command Line is far from being a crusty old relic,” opined Google+ blogger Linux Rants, for example. “It still holds more power and versatility than can be found in any GUI on the planet.”
It’s true that “GUIs are pretty and have great eye candy,” Linux Rants conceded. “They make computers easy to use for people that don’t want to actually get to know their computer, but they hold only a fraction of the power that you can get from a command line.”
GUIs are also significantly slower to use, he added: “Just the simple task of separating two kinds of files from a single directory, ‘mkdir GIF;mkdir JPG;mv *.gif ./GIF;mv *.jpg ./JPG’ and I’m done — five seconds to accomplish that. How long would it take in a pretty looking GUI?”
‘The CLI Is Far From Dead’
Indeed, “as soon as someone shows me a way to efficiently construct a for-next loop in the GUI that lets me manipulate a series of files in a particular set of ways, I’m there,” agreed Hyperlogos blogger Martin Espinoza. “Until then, there’s bash.
“Cute pattern-renaming tricks in file managers just don’t cut the mustard compared to being able to use xargs, sed, tr and so on to allow one program to act on the output from another program, and having to use a whole bulldozer when you just want to reinvent the wheel slightly doesn’t make any sense, either,” Espinoza added.
“The CLI is far from dead, and nothing can beat it for complex tasks,” echoed consultant and Slashdot blogger Gerhard Mack. “Even Microsoft has realized that and pushed a better command line for their servers for the last few years.”
‘Different Tools for Different Jobs’
Chris Travers, a Slashdot blogger who works on the LedgerSMB project, took a similar view.
“Saying that GUIs obsolete CLIs is like saying word processors obsolete Emacs or VIM,” Travers opined. “They are different tools for different jobs.”
Travers sees it as a matter of information density.
“A GUI is very good at providing dense info to the user, but very poor at receiving dense info from the user,” he explained. “A CLI is a bit more rounded but will never be as good at providing dense info to the user as a GUI is. Where it really excels is in receiving dense information from a user.”
‘Keystrokes Are Just a Better Way’
Case in point: “Imagine how many mouse clicks and keyboard strokes it takes to tell a GUI ftp program, ‘download file.txt but into myfolder, not the current local directory, and rename it to myfile2.txt,'” he suggested. “Last time I tried this it was at least 8 clicks plus typing.”
In a command line ftp tool, on the other hand, “you just type: get file.txt myfolder/myfile2.txt,” he pointed out. “Much easier, and the typing better flows from thought.”
So, “there are many tasks, including many sysadmin tasks, where GUIs do provide better tools,” Travers concluded. “But there are many more areas where keystrokes are just a better way to tell the computer exactly what you want done.
“Just as surfing the web in elinks (a terminal, text-only browser) can be a bit painful, so too can managing computers at the GUI be needlessly painful,” he said.
‘Keep It as an Option’
Roberto Lim, a lawyer and blogger on Mobile Raptor, wasn’t convinced.
“Using the Command Line evokes a sense of pride, so I expect to get flamed by your readers,” Lim told Linux Girl. “But I have to admit, I usually wind up typing commands from a guide without fully understanding their import.”
The Command Line Interface has its uses, Lim acknowledged, “but no piece of technology targeted at the consumer market should ever require that something be done via CLI; keep it as an option or you can take it out all together.
“If it is there, it should just be there for the IT people or tech support to use when you encounter a problem,” he opined.
Put another way, “it is like creating a website via gedit,” Lim concluded. “It’s cool. But in this day and age, who really wants to type ‘
‘ instead of just pressing the ‘Enter’ key?”
So, “is it a ‘crusty old relic?’ Most people do not even know that it is still there,” he added.
‘It Is a Server OS’
Slashdot blogger hairyfeet took an even stronger view.
“YES YES YES!” hairyfeet began. “There are only TWO reasons to use CLI — repetition and scripting — and how many desktop or laptop jobs require writing scripts or repeating the same actions constantly? That would be pretty much none, which is why I say as long as CLI is the dominant way to do anything in Linux, it is a SERVER OS and not a Desktop OS.”
To wit: “If you think Linux is ready to take on the desktop, then accept my challenge,” hairyfeet said. “Take ANY distro and REMOVE CLI for a period of one year. Make your OS behave as does every actually modern OS does on the planet.
“Sadly I doubt you’ll even be able to get most Linux distros to boot at all without Bash or some other shell,” he predicted. “It has become such a crutch for everything that I doubt you’ll even get to a desktop without it.”
‘Gold and Diamonds Are Ancient, Too’
That view, however, was far from undisputed.
“BASH commands and scripts are a wonderful tool for system administrators,” blogger Robert Pogson offered. “Few others users need to bother with them.”
That said, “such things may be crusty, but they work very well,” Pogson opined. “I can type a command and check the time on every machine on my network, or update software, or add a particular application to a particular list of PCs or all of them.
“That’s priceless,” he added. “Gold and diamonds are ancient, too, but they are valuable.”
‘A Unifying Force in GNU/Linux’
In fact, “one thing that I find valuable with scripts and commands in GNU/Linux is that with hundreds of distros, it’s all but impossible for a system administrator to be conversant enough with all the distros to do all the basic operations without commands and scripts,” Pogson pointed out. “The same goes for helping novice system admins or remotely administering a PC.”
So, “I like to call that language the lingua franca of GNU/Linux, covering all distros on all PCs with any installation,” he said. “A Debian guy can help a Red Hat guy or vice versa, even if one uses GNOME and the other uses Xfce.
“Can an XP guy help a ‘7’ guy?” Pogson added. “Maybe. Maybe not. Can a Debian Sarge guy help a Debian Squeeze guy? Yes. Commands are the right way to do IT. It’s a unifying force in GNU/Linux.”
For anyone who wants to remove the command line from Linux, I’ll believe it *might* be a good idea when it is torn out, like a beating heart, from Mac OS itself.
The thing is, Graphical Interfaces are pretty. I sometimes wish I can "print" graphics from a command line. But they are also so…rigid; they are so…fragile, and complicated. Just *try* to write a "Hello World" program under a Graphical Interface, and compare the same program to a Command Line Interface. Command Line interfaces are simply easier to program under!
Now, you might say, "But why should *I* care about programming? I just want to use the darn computer!" Never mind that *every* programmer has to start somewhere, and that someday, every so often, a user will wake up and say, "I’m going to learn how to program today!" And the Command Line Interface will be waiting for such people, and will be welcoming them.
A Command Line Interface is simple. And it can be a bit cryptic. But once you learn the commands, with that simplicity comes great power, and *that* is why, under Mac OS X, you can access the terminal under "Applications->Utilities". And that is why I will resort to using a command line over a file manager almost every time.
I have a tablet with Android OS on it, and it annoys me greatly that I haven’t yet been able to install a shell, because I have been denied root access. I seek for power, and that power is at my fingerprints when I can call up a shell!
Finally, I don’t know when Hairyfeet last installed a Linux Distro, but it’s relatively easy to install a system without resorting to use a command line, unless you’re using something like a "kickstart" script (which usually means you’re doing something server-ish or developer-ish anyway). The *closest* I’ve come to a command line, is a text-based menu that usually also recognises a mouse! Even that is kindof rare…
Last I checked, you *have* to use a keyboard to type values into a spreadsheet, or sentences into a word processor. Or are you saying we should all use on-screen keyboards, and enter everything into our computers with mice?
When Android and iOS have on-screen keyboards, it’s because physical keyboards are bulky, and add a bit of weight to the computer. It’s *not* because those on-screen keyboards are more efficient!
Check out Microsoft’s Windows 2012 Server new feature … Command Line System Console support to improve System Administrator productivity.
When administrating HP-UX, Sun Solaris or Linux servers I use command line because I am five times more productive than using a GUI interface.
Linux is already the OS of choice on every platform except the desktop (embedded systems, servers, and high-performance clusters)
A Unix command line/ shell language is the most powerful and graspable programming tool for the common person. Being able to redirect text between programs allows you to do some very powerful things with a handful of lines. A single line of shell script can sometimes do more than ten thousand lines of C.
If you don’t want to participate in your computing environment, then gran an android and stop complaining. Because of the areas where Linux is the most successful, many of the core systems will remain heavily reliant of shell scripts and textual interfaces and pipelines.
Sigh, that is a SERVER OS which is what I already said! We are talking about desktops, NOT your server, cluster or toaster.
If all you want to be is a server OS then just say so, don’t pretend its a desktop when your answer is "her derp WinServer" when people point out why it don’t work. or do you REALLY think home users are running Winserver?
GUI = WYSIAYG (WHAT YOU SEE IS ALL YOU GET)
The GUI is DEFINITELY good for doing anything that requires graphics or sometimes non-repetative tasks, however you can’t match the power of the command line with anything else that I’m aware of, as detailed in some of the posts already.
One person can manage hundreds of computers (I managed up to 200 computer workstations and servers alone) with the command-line but much fewer with a GUI-only environment (I believe you can find lots of information and studies to back that up if you Google for it).
My comment on GUIs is they are WYSIAYG (WHAT YOU SEE IS ALL YOU GET). You can’t do things they weren’t designed for with GUIs whereas with the command line you can do all sorts of things the original CLI designers didn’t imagine if the CLI tools are well-designed and use the principle of "do one thing and do it well". The Command Line Interface is the "glue" that quickly and easily brings all the small but powerful CLI tools together to do the job, with scripting as well if you for some reason can’t do it with just bare CLI.
HOWEVER, for people who have no desire to learn how the computer works, well, I guess they are stuck with the less powerful GUIs.
No offense to them, they just aren’t interested, probably like I’m not interested in learning the innards of the car to do my own repair work.
However, kind of a shame because with a little bit of learning they could increase their efficiency and production, just like kind of a shame I’m not interested in details of car innards as I could probably save a lot of money on car maintenance/repair if I would learn.
I normally only repeat a task about a maximum of three times before I try to automate it with CLI or scripting. I don’t have the patience to do the same tasks over and over and over again when the computer can do it for me.
"The computer should work for us, we shouldn’t have to work for the computer". – Me
I don’t think the CLI is going to go away. It has too many advantages. I couldn’t live with out it.
Even M$ is making the GUI "optional" in their next server installment from what I hear.
Everyone has different requirements, learning, environment, etc, and use computers for different things.
I doubt the DEBATE is going to go way, and I also doubt the command line will go away.
I’m not sure why people think you HAVE to do it one way or another. You CAN run things more EFFICIENTLY with the CLI but you can still do things with the GUI.
Of course, I’m just one data point and opinion.
So take it with a grain of salt and $0.02. I just stumbled across this interesting article and comments…..
The author is right the comments are wrong
No Linux OS can ever become nr1 OS as long as it requires you to type anything, it is much easier to click, EVERYTHING should be doable with clicking, you can of course keep the terminal and writing but as long as EVERYTHING cant be done via clicking no Linux will be nr1
That is Linux biggest problem fanatics who simply do not understand that most of humanity want to click and not learn how to program.
Programing via command line is only realistic for a small number of people, the rest want to be able to click.
In my small computer business I fix mostly Windows computers, but I use Ubuntu for almost everything in my office including the retrieval of invoices, work histories, configuration diagrams, all my bookkeeping files, along with rsync backups, etc. between office and travel computers, and our file server. Without my 100+ CLI scripts that span Bash & Python, I’d be lost trying to get things done after a long day.
The scripts save me trying to remember what switches I should use, whether the source file goes first or after the destination file, etc. I update webpages using Python scripts that would otherwise require me to mess with individual tags on complicated text pages of code. My stuff is all menu driven in Bash using the CLI. It’s the only way to go for me. I simply can’t do those kind of things efficiently any other way.
I agree with walkerreuben in making a website in gedit. Any web developer worth his weight must get down and dirty with the code at one point or another. Otherwise you’re just a simple designer.
As for getting rid of cli. HA! Not going to happen. I came from windows and now have a cli only computer because I love it so much and I’m only 23. You can’t just hate it and be done with it, you have to try to learn it. And then you’ll fall in love.
But think about this. Should we really dumb down our OS for people who are new, or should we make them smarter instead?
"Put another way, "it is like creating a website via gedit," Lim concluded. "It’s cool. But in this day and age, who really wants to type ‘< P >’ instead of just pressing the ‘Enter’ key?""
Fail. It should have been "who really wants to type ‘< / br >’".
And there are a ton of perfectly good reasons to use gedit to make a website. I’ve had heaps of fun writing my website that way. You’ve got so much more control over every little detail.