News for hackers. Stuff that matters.
Re:Bicycle skills by pdelgallego on Wednesday August 01, 2012 @10:42AM (#4323115)
The command line is a bicycle skills. Any programmer should learn it.
Re:Bicycle skills by stephengillie on Wednesday August 01, 2012 @10:50AM (#4323163)
Do some people really find the command line so difficult to use? I'm quite the opposite so I have trouble believing it.

Maybe it's because the default black background makes it feel like we're throwing our commands into a "magical pit inside the computer", and waiting for the output, which will be an error unless the commands were perfect. That perspective is unpleasant.

Maybe it would be helpful to visualize a GUI while using the command line, where instead of clicking on a menu or button, you have to type its name.

Re:Bicycle skills by mechanical_fish on Wednesday August 01, 2012 @11:19AM (#4323355)
Do some people really find the command line so difficult to use?

Yes. Very yes. To the point where, when you say "some people", what you really mean is "most people".

I don't think the problem is "the command line" so much as it is "the Unix command line". You don't see a lot of people having difficulty with text-adventure command lines. You demonstrate HELP and GET LAMP and they're off to the races.

Whereas Unix commands are hard to discover unless you already know their names, have illogical names, have inconsistent behaviors, have poorly designed documentation (every command has 27 options and they're often documented in alphabetical order on man pages, with the obscure corner-case options given equal weight to the most useful ones), require combinatoric thinking (because many options can be used at one time), take invisible actions ("gzip foo" returns no output and modifies a file in your current directory; you need "ls" to see that it did anything), are context-dependent (you need to know what a "working directory" is or you won't get past square one), and often require a working knowledge of pipes and redirection to be useful (and pipes and redirection aren't intuitive skills).

You need to read a book. Nobody has time to read books. Reading books is a bicycle activity.

Re:Bicycle skills by Splines on Wednesday August 01, 2012 @11:50AM (#4323554)
It would be interesting to use a command line interface that acted like a text adventure game.

  > get file.txt
  YOU PICK UP THE FILE
  > inventory
  YOU ARE HOLDING:
  file.txt
  > gzip file.txt
  FILE.TXT HAS BEEN COMPRESSED
  > inventory
  YOU ARE HOLDING:
  file.txt (compressed)
  > drop file.txt
  YOU CAN'T PUT THAT HERE, THERE IS ALREADY A FILE.TXT HERE
  > rename file.txt file.txt.gz
  FILE.TXT HAS BEEN RENAMED
  > drop file.txt.gz
  YOU PUT DOWN FILE.TXT.GZ
Obviously not ideal, but at the very least the idea of inventory-as-clipboard would be useful on the command line.
Re:Bicycle skills by slurgfest on Wednesday August 01, 2012 @03:27PM (#4325083)
This is interesting enough to criticize :)

OK: you can get file.txt; gzip file.txt; rename file.txt file.txt.gz; drop file.txt.gz. However, it requires a get and a drop to fiddle the inventory, which doesn't seem to do anything (you are still specifying all the filenames each time).

And I don't see a reason to generate a gzipped file of 'the same name' and then do a rename, it seems better for the new name to be an argument to the gzip operation.

All you really want is to send information from file.txt through gzip to file.txt.gz. As in "gzip < file.txt > file.txt.gz" or "cat file.txt | gzip > file.txt.gz".

But it feels like there should be cases where the clipboard/temporary holding area is much more useful than it is here, I just can't think of them?

Re:Bicycle skills by stephengillie on Wednesday August 01, 2012 @01:21PM (#4324260)
That's a very fun idea you have there :)
Re:Bicycle skills by PotatoEngineer on Thursday August 02, 2012 @12:32PM (#4329537)
You are in a twisty set of deeply-nested directories.
Re:Bicycle skills by yen223 on Wednesday August 01, 2012 @09:53PM (#4326802)
When Windows has a command line tool (Powershell, not their crappy native CLI) that's powerful and like 100x easier to comprehend, you know the Unix command line is due for a disruption.
Re:Bicycle skills by prawks on Wednesday August 01, 2012 @11:11AM (#4323303)
I believe the reason people feel it's difficult is that a blank prompt is inherently not intuitive. There's no way you can hand someone a command line interface with an empty prompt and let them fiddle with it. They need to know what to type to start doing what they want to do beforehand, there's no way you can really "experiment" when you don't know where to start.

It's very similar to many mainframe interfaces with non-intuitive commands. Many legacy IT departments have these. Questions like "How do I do X?" have answers from experts like "Type XKY= and then hit PF3". But that sequence of steps is nowhere on the current screen's list of commands, or in it's help documentation. You just need to know it.

This is in contrast to a GUI where every single thing you can do (aside from keyboard shortcuts) is visible. I can hit a random button and see what happens. In a CLI, there are too many possible alphanumeric strings to try, so I can't do the same thing.

(This is of course different if the prompt is not blank, and says "Type 'help' for help")

Re:Bicycle skills by agumonkey on Wednesday August 01, 2012 @02:59PM (#4324905)
Those shells still inherits genes from the terminal era where metacircularity wasn't affordable. Emacs got a free meal from lisp so it can inspect itself and suggest to the user even in command line style.

Recent shells have done good efforts to provides some kind of typing and deduction to reduce friction. It's always nice to have a listing of /etc/hosts or ssh known hosts in place. Browsers picked this since the coming of 'smart' url-bars.

I hope one day we would go all-alan-kay on this and simply have a meta-capable system that parse/cache relevant data straight from the source so you don't need to do any extra work to make the system understand a bit your additions.

Re:Bicycle skills by kaybe on Wednesday August 01, 2012 @04:33PM (#4325505)
It's even less fun when the computer talks in English and you don't - no guessing keywords. (as happened to me when I was a kid.)
Re:Bicycle skills by drcongo on Wednesday August 01, 2012 @11:37AM (#4323465)
This is an interesting point. My experience is that a lot of people find the command line scary, as they never quite feel in control. I wonder if it's possible to create the command line equivalent of LightTable. Something that visually shows the user what their command is doing, or more importantly, about to do.
Re:Bicycle skills by Tloewald on Wednesday August 01, 2012 @05:34PM (#4325878)
Back in the 90s Apple had MPW (a command line development environment) and AUX (its own UNIX implementation for 680x0 Mac hardware). Both featured Commando (type a command followed by an ellipsis and hit ENTER and visual dialog would appear letting you condfigure the command). When you clicked OK (or hit return) the resulting command would be typed into your window.

MPW also allowed you to differentiate between target and command windows very easily, so you could keep your favorite commands handy and have the output funneled to other views.

Not Lighttable, but a lot more useful than man pages in 99% of cases and pretty darn nice.

Re:Bicycle skills by drcongo on Thursday August 02, 2012 @06:31AM (#4328102)
Thanks, I'd not heard of that.
Re:Bicycle skills by RegEx on Wednesday August 01, 2012 @10:55AM (#4323195)
The command line isn't difficult, but sometimes it's difficult to convince someone who has never "needed to use the command line" that they should give it a shot.
Re:Bicycle skills by ibotty on Wednesday August 01, 2012 @01:49PM (#4324469)
unix is very user friendly, it's just picky who it's friends are...

(having said that, with unix you can be extremly productive and it is (more or less) designed to be easily understood once you grasp some concepts.)

Re:Bicycle skills by Derbasti on Wednesday August 01, 2012 @02:08PM (#4324592)
Just today I had a discussion with one of my colleagues. There are tons of people (most of whom matured when Windows was hot), who simple weren't exposed to the command line ever. Teaching Git to them is torture for both the teacher and them. Anything about scripting is magic.

It's tough.

Re:Bicycle skills by Kiro on Wednesday August 01, 2012 @11:00AM (#4323234)
Why? I still haven't found a tool which doesn't have an equivalent GUI.
Re:Bicycle skills by tsahyt on Wednesday August 01, 2012 @11:10AM (#4323294)
One word: Scriptabilty. I still haven't found a properly scriptable GUI. On the command line I can automate almost everything and customize it to my needs. Additionally I'm way faster on a CLI for almost any task I do as a programmer on a regular basis than with any GUI.

For me personally, not just tasks I do when programming, but almost anything I do on a computer. The graphical display capabilities are merely a way of displaying content for me (PDFs, web-pages, etc.).

Obviously, if you're dealing with graphical content you want a GUI though.

Re:Bicycle skills by ColinWright on Wednesday August 01, 2012 @11:25AM (#4323383)
Here's a task I had to accomplish recently:

    For two different directories,
        find all duplicate files that are
            both less than 10 minutes old
This was easily accomplished in a few lines of bash, and then scripted, because I knew I'd have to do it again and again.

I'm not accomplished with GUI tools, but I'd be interested to know how this would be done via a GUI.

Re:Bicycle skills by spydum on Wednesday August 01, 2012 @09:40PM (#4326759)
Lines of bash? Seems like find all by itself should be enough (one line.. maybe a few pipes)
Re:Bicycle skills by ColinWright on Thursday August 02, 2012 @03:33AM (#4327739)
I don't know how to persuade 'find' to identify files in directory A that are identical to files in directory B. But my point stands - I can accomplish this quickly on the command line, and know of no GUI tools that would let me do it.
Re:Bicycle skills by Kiro on Thursday August 02, 2012 @09:43AM (#4328675)
See. Your discussion proves my point perfectly. Too much hassle.
Re:Bicycle skills by ColinWright on Thursday August 02, 2012 @10:33AM (#4328921)
I can't work out if you're trolling or not, but your comment doesn't make sense at all. I needed to perform a task, and I did so fairly trivially from the command line. Someone else offered what they thought might be a shorter alternative, I pointed out that the task was more complex than they thought.

You take this as evidence that it can be done from a GUI?

So, let's go back to your comment. You said:

    I still haven't found a tool which
    doesn't have an equivalent GUI.
If you want to make me take you seriously, please tell me how you would:

    Given two directories,
        find all duplicate files that are
            both less than 10 minutes old
In other words, given directories A and B, find all filenames f such that:

    $A/$f is less than 10 minutes old
    $B/$f is less than 10 minutes old
    $A/$f is identical to $B/$f
Now tell me how you would do that every hour for a week.
Re:Bicycle skills by JoelMcCracken on Wednesday August 01, 2012 @11:07AM (#4323278)
Do you use both?

Edit: I wanted to add a few more comments.

Someone mentioned scriptability, also composability, speed, "multitaskability".

Re:Bicycle skills by dbecker on Wednesday August 01, 2012 @11:12AM (#4323314)
The point isn't that you can do more with the command line, the point is you can do them so much faster.
Re:Bicycle skills by recursive on Wednesday August 01, 2012 @11:19AM (#4323354)
I haven't found that to be the case.
Re:Bicycle skills by corford on Wednesday August 01, 2012 @05:47PM (#4325935)
It doesn't get much faster than executing a bash script. A GUI can never hope to match that.
Re:Bicycle skills by recursive on Friday August 03, 2012 @09:05PM (#4337017)
I'm not sure what that's based on. For example, selecting a subset of items from a given list seems to be faster in a GUI than I've ever seen it done on a command line.