2009
12.16

Why the CLI sucks.

I’ve heard some ridiculous claims concerning usability and the command line, my favourite being ‘It’s really usable when you’ve learned how’.  Which is total rubbish when you think about it as anything is easy once you’ve learned it.  Using that logic a machine running (say) Arabic Windows, complete in it’s RTL glory, is just as easy to use as one with English Windows installed as it’s just a case of learning it.  Right.

The thing is the command line is the antithesis of usability.  It’s the exact opposite of where modern computing is going and it is, quite literally, a regression of over 20 years of progress.

Here’s the thing.  A GUI interface is decision based.  You look at what you have and decide a course of action based upon the options presented.  A CLI is knowledge based.  You have to know exactly what you need to type before you type it.  The beauty of a GUI system is you do not need a manual – you do not need to invest weeks learning concepts, commands and other irrelevant arcana. It’s the difference between following roadsigns and trying to get home blindfolded.

For example anyone reasonably confident could find how to change power settings, drive mounts, record some audio or any simple task on Windows (or any decent GUI based OS)  in a few minutes without needing any help, manuals or other assistance.  With the CLI approach you are no longer able to operate on your own volition, instead you have to seek out howto’s, manuals and ask for help in forums.  If there is no documentation or someone to ask then commonly there is no way to solve your issue – more often than not it is impossible to figure out the solution on your own.  Linux essentially strips you of your independence.  And God help you if you have a problem that breaks your internet connection.

If you use Linux you are beholden to the technical elite and their whims.  The depressing part is it is viewed that this can all be solved if only enough documentation is written when everyone else has figured out that documentation should not even be necessary in the first place.  It should be obvious what you need to do.

The Walled Garden

Essentially, and unlike Windows or OSX, the Linux user interface paradigm is a dichotomy.  Instead of having a unified interface that everyone uses you have a two-tier system where you have the ‘real’ Linux users consisting of developers and power users, who rely largely on the CLI, shell scripts, vi and other non discoverable, non intuitive, complicated and extremely difficult to master concepts.  Then you have the normal users who get to use the GUI scraps off of the power users table.

Which is largely the problem.  You have a GUI interface, but it is really just a flimsy facade put up over the CLI underpinnings.  It’s a walled garden of ‘ease of use’ in that as soon as you need to do something outside the remit of what the GUI allows you are immediately dumped into nerd hell in which 99% of the population have no hope of ever understanding.  Stuff which is incredibly simple on other platforms such as installing drivers, installing software, mounting partitions or even changing your screen resolution can quickly turn into half-day Google marathons on Linux if your needs happen to not be covered by the GUI (and thus are outside the garden).

Take NTFS-3G for example.  Last time I tried to use that the volume I tried to mount was marked as dirty.  The GUI tool had no handling exception for this so it just blurted a load of CLI comands into a dialogue box – since it is just a wrapper around the command line version.  You see it all the time in Linux.  Rather than the standard approach of writing an API and interfacing with that large swathes of the GUI is simply calling a CLI command and scraping the result.  No wonder it’s so flaky all the time.

Essentially the problem is that users are viewed as people that need something stupid, something dumbed down, that essentially they have different needs than ‘real’ computer users and as a result you get this system of intellectual apartheid where the ‘dumb users’ only get to play in the padded room and ask an ‘adult’ for help if they have a problem.

Speaking as a user and a developer I am sick of the elitism, of the machismo, of the walled garden.  I don’t want to read howtos.  I don’t want to learn useless, arcane, commands.  I don’t want to spend two days plugging in random commands in the vague hope that my wireless may start working at some point.  It’s not that I don’t know how to use a CLI, it’s more that I have better things to do with my time than fight with the creations of developers too lazy to go the extra mile and understand the whole raison d’être of a modern OS, which is empowering normal users to get stuff done on their own without having to get a degree in CS first.

Update

I saw someone complaining about how it was so difficult to set up a manual IP on Windows with the GUI, how it was so confusing and how Linux was better.  Guess what?  You can easily do this with the Windows CLI also.  As pointed out though, unless you know the exact command and the exact parameters you have no earthly way of figuring it out and if he had gone from Windows, where a GUI is available, to Linux, where it isn’t (or is broken), then he would have failed entirely rather than just taken a bit longer than normal.

35 comments so far

Add Your Comment
  1. The biggest pity is that Microsoft are heading the same way with PowerShell, especially in Exchange 2007.

    I don’t want to have to learn cmdlets for basic Exchange admin tasks. The GUI worked! To add insult to injury, some tasks are no longer possible in the GUI.

  2. I know. I think it’s the new generation coming up who don’t remember the horrible pre-GUI DOS era and think that the CLI is somehow the way it’s ‘meant’ to be done, since they don’t remember the days when that was all we had.

    Ideally the CLI should be thrown away and replaced with what it is trying to be – a programming language. Either be a programmer or be a user, rather than trying to somehow make users programmers and claiming it’s a good thing.

  3. I agree with almost every point in this post and in your entire blog, however, there’s one issue:

    I master the UNIX/Linux shell pretty well, and to be honest, I’ll always have to keep at least one Linux etc. machine around, because the CLI simply enables you to do things that are impossible to do with the GUI – and yes, I do need these things often.

    For example, how do you do the following with Windows Explorer: Find all files below the current directory that are named ICMS-PAGE, check if they contain ‘foo’, and if so, delete them? (There are 10000 directories with 10000 ICMS-PAGE files).
    This is one single command in the CLI, yet, impossible to do in the GUI (afaik).

    Or: Which of all the files in all subdirectories whose name contains “page” contain the line “blah”, and if they contain it, remove it?

    Again, a more common task (as a software developer) than you might think. Easy to do in the CLI, impossible to do in the GUI.

    Again: I agree with you in almost all points. It’s a pity that current “shell-like GUIs” can’t do everything CLIs can do.

  4. (Obviously, you could write a ‘mini-program’ that replaces the shell’s functionality for such a specific task, but that still takes way longer than just using the shell.)

  5. Naturalbornchiller – It’s true that there are occasions where the CLI is incredibly useful – having more tools available can never be a bad thing. My main issue is that the CLI, which is only really usable by a tiny fraction of the users is considered the main interface, while the GUI which arguably has much more people using it is a crufty second-class citizen, unable to perform even some basic tasks.

    As a side note I reckon that if you wrote a program in Windows that could interface with the Windows Search API it would be an order of magniture faster than any CLI grep solution as you could take advantage of the built-in fulltext search and indexing features of Windows.

  6. @Natrualbornchiller that is a specialized use case although my hunch is you may be able to achieve something similar with Automator on OS X.

    My own personal experience with your walled garden of usability was an incredibly frustrating experience trying to attach an external harddisk to a linux running computer. NTFS drivers are supported easily due to a misfeature that NTFS permissions aren’t properly respected. As a result anyone can write to the drive. Well, try and format the external drive in a Linux native fs like ext3/4 and normal users cannot access the external hard drive because the default permissions root:root 770 or something like that. Furthermore, you can’t authenticate in the file manager to change these to something sensible which means that you have to drop to a shell and change them yourself. I guess the Linux talking heads decided that anyone who is using an external drive with linux is using one of those pre-formatted drives into NTFS.

    That said, the cli still has its uses in development. It would be a royal pain to launch small prototype programs if you had to set everything by a GUI. And while you’re there you might as well learn how to move/copy/delete

  7. Windows filesystems are indexed, so searching is really fast. I’d just go to the directory I want, click on the search box, and type in “ICMS-PAGE foo”, and then delete all the results. Easy. Same goes for your second example.

  8. I hadn’t thought of doing that. The same is true of OS X, no automator required.

  9. “….a machine running (say) Arabic Windows….”

    I just had to pull this out for a random anecdote. I once knew a guy who switched his Windows GUI fonts to Aurek-Besh (that weird alphabet used in Star Wars).

    While it looked interesting, it did not make for a great productivity improvement.

  10. poiuytrewq: You clearly didn’t read neither of my examples.

    The approach you’ve suggested is extremely inaccurate and would find far more files than requested: Files whose name only CONTAINS ICMS-PAGE, files which in turn do NOT contain ‘foo’, files with the name ‘foo’, files whose name contains ‘foo’ etc… that’s all not what’s wanted and just deleting all the results would with high probability destroy the entire application or its database.

    Concerning the second example: I didn’t mean to remove the entire *files*, but only the *lines* *inside* that read ‘blah’. Clearly this is not possible using your approach nor any GUI-based tools integrated in Windows.

  11. Kerberos: It’s OK – as I said, I agree with you almost 100% :) 99% of the time, you only *need* the CLI for very specialized tasks, probably 1% of all tasks done with a computer :)

    Still, Windows is lacking such an ‘advanced’ shell (afaik), and that’s a problem.

  12. Powershell: http://en.wikipedia.org/wiki/Windows_PowerShell

  13. Declination: Very interesting, hadn’t heard about that.

  14. “I didn’t mean to remove the entire *files*, but only the *lines* *inside* that read ‘blah’”

    If that is the case then you can probably do it with a regex based search and replace with something like notepad++.

  15. Not that I’d exactly say regexes are ‘user friendly’, but sometimes you just can’t simplify it that far.

  16. I mentioned the Arabic Windows as I used to do computer support for a lot of foreign exchange students, so half the laptops were in mandarin, korean, arabic, etc. It was amusing to see the look on their faces as you’d set up custom TCP/IP settings while being unable to read anything (or even have everything flipped horizontally as in Arabic). I think a lot of them thought I could read it. :)

  17. Out of curiosity, are the boxes on the other side of the labels when RTL is engaged? I’ve never seen a computer set to a RTL language before.

  18. @Naturalbornchiller, if you’re really needing to do that kind of stuff for development, you should probably looking into some proper refactoring tools. These go far beyond the text recognition properties of the CLI because they actually understand the code itself. For example, you can tell a refactoring tool to rename a class and it will rename all instances of it throughout your codebase. Complete with a pre-flight review process.

    While the CLI may be _one_ solution, in your situation, it isn’t the _best_ solution.

  19. @Kerberos, I want to donate this Piestar logo I made. Do you want it? (sorry for using your comments but I don’t know how else to contact you)

  20. TM Repository: The development thing was just an example. For example, I have developed a dozen systems that store stuff in file-/directory-based databases. If I want to convert those for a new version or so, this stuff is invaluable as well. And the advantage of the shell is that it is so generic. There isn’t an “instinctive ICMS database refactoring tool” so far ;)

    Another example: ICMS (my CMS) flags a page as ‘locked for editing because someone is already editing it ™’ by placing a file ‘ICMS-LOCK’ in the page’s data directory. This file stores the name of the user who has locked it in a particular form. If I want to check what page user ‘foo’ is on, I can do that easily with a single egrep command. No ‘development refactoring tool’ can do that ;)

    Yes, of course, I could also develop a feature inside the CMS that will let me do that. However, if I developed a custom feature including appropriate GUI for each single thing I’d like to do once in 3 years, dude, I’d be coding all day and night ;)

  21. (Yes, I know, I should be using SQL… ;) )

  22. @Naturalbornchiller, I was just about to say…

    It sounds like your still needing to use the CLI to compensate for technical deficiencies. Were you using a more “correct” approach then a database migration, clean-up, or table lock with proper transactions is far faster, safer and better understood by anyone who has to use your code base.

  23. @TM Repository: Yeah, maybe, it’s quite snazzy. kerberos@piestar.net – drop me an email. Do you have it in PSD/AI format or anything?

  24. The CLI sucks as a primary means of operation, you got that right with all its disadvantages, but in a few cases it’s handy to have a flexible, powerful CLI available. Linux users often give an example of a neat CLI command (or a chain of commands), use that example to state that “the CLI is great” and then extrapolate this to “CLI > GUI”. Which is bullshit as well.
    Best practice: use GUI for almost everything. In the rare cases where using a CLI makes sense, use it instead. I don’t view the CLI as a direct competitor to GUI. It’s more like an additional feature.
    And since all of LinuxGUI land is, always was and always will be terrible, best practice is to use Windows or OSX and install whatever CLI stuff you need there, then use it when it seems like a smart option.

  25. The CLI-based install in Windows Server 2008 R2 can be remotely controlled via GUI from an account with access to do so :)

    Great overview:
    http://arstechnica.com/microsoft/news/2009/12/windows-server-2008-r2-in-depth.ars

  26. Agreed 100%! Everything is being done with a GUI these days.

  27. You can search for all the files that contain “foo” and delete them via the GUI. Use the file search (press F3 in Explorer) then delete the results.

  28. Besides everything mentioned here, there are many shareware and freeware GUI tools specializing in file name manipulation, with all the regex hooks you’d need.

  29. @Thomas B,

    Flip-flop much? You have made posts in the past espousing the wonders O’ the CLI, now you sing a different tune. Aren’t you worried about losing your “geek cred” at your LUG?

  30. @Thomas B, how’s the OpenSolaris Linux going for you these days?

  31. @Mr. Furley

    No, I haven’t.

  32. *GUFFAW!* OpenSolaris Linux.

  33. GUI stands for “graphical USER INTERFACE”.

    CLI stands for “command line interface”.

    Notice the lack of the word “user”. Command lines are an interface for programmers, not users. They’re a way to enter programming language commands one line at a time (like, for instance, the interactive Python interpreter). They’re fine for what they are, but they’re not a fucking user interface.

    A good interface would be intuitive, discoverable, memorable, and forgiving. The Linux CLI is the opposite of these.

    I’ve seen people argue that the CLI is more powerful because it’s like language, while the GUI is just pointing at things like a troglodyte. Of course, this is absurd.

    Is language a good paradigm for user interfaces? YES! But the CLI is not even close to language. “grep awk -d sed /path ls sudo” is not a human language. Language is flexible and forgiving, and maybe most importantly, is full duplex. When you talk to someone, if they don’t understand what you’re saying, they can give you instant feedback to clarify it. A good interface provides feedback as quickly as possible so that you know what you’re saying is being interpreted the way you intend.

    The interface developed by Mozilla for Ubiquity is much closer to what we want, but even the search bar in Windows 7 is more useful than bash.

    https://mozillalabs.com/ubiquity/

  34. Also everyone interested in this check out http://www.fishshell.org/, which is quite a bit nicer than the usual, but still not great.

  35. http://www.osnews.com/story/6282

    “Experience with the CLAIT class above showed two things about the CLI method. One was that it mapped very naturally onto existing models for interaction. Users very quickly picked up on the ‘ ‘ syntax for commands and found it very useful. The second, most important, thing was that users reported that they felt more ‘in control’ with the CLI.”

    “All users, after an initial bootstrapping phase, preferred the CLI “discussion” method for interacting. All reported that they felt more in control and better able to find things out. This probably was due to the higher amount of interface consistency and more task-based interface that the CLI tends to encourage.”

    The CLI doesn’t suck, it has as much relevance as GUIs, even today. Especially when administering multiple machines (like render farms or clusters).

    Btw, your blog (what I saw of it) reminds me of either a big troll, or of someone ignorant and/or biased. Basically, pretty stupid, if you don’t mind my opinion. The only positive thing I saw here is the bashing of linux zealots. :|