News for hackers. Stuff that matters.
Re:Command-line Fu by azanar on Sunday March 22, 2009 @08:45PM (#527748)
It would be really cool if shell lines included some sort of hyper-linking to man pages based on the grammar of each shell command and its arguments. Have one line that is the hyperlinked command, and another than has the command in a textfield. So rather than just a site of semi-magical incantations, it can be a catalyst for exploratory learning.

It is a little-pie-in-the-sky, I admit. The top command when I visited was `sudo`. What argument `sudo` takes depends upon the shell the user is using to execute `sudo`. Perhaps this could be a preference set somewhere, along with the OS being used. And maybe have a sister site where people contribute shell command grammars in some standardized syntax. I wonder how many people would be willing to provide those, though. Hmm.

This wasn't mentioned in the prior submission of this site, and it didn't occur to me until seeing it again. Just thinking out loud.

Re:Command-line Fu by silentbicycle on Sunday March 22, 2009 @09:30PM (#527797)
I think that's a great idea, though it's worth noting that the command line options to commands can be subtly different between Linux and BSD (and sometimes different Linux distros). It helps when people use the long options (--quiet rather than -q), when available; they're usually easier to translate.
Re:Command-line Fu by brianto2010 on Sunday March 22, 2009 @06:16PM (#527543)
This site was submitted for review here not too long ago.

http://news.ycombinator.com/item?id=467692

Re:Command-line Fu by halo on Sunday March 22, 2009 @07:31PM (#527633)
There's also the very similar http://www.shell-fu.org/
Re:Command-line Fu by mariorz on Sunday March 22, 2009 @10:36PM (#527875)
for the osx crowd, try:

  man -t UNIX_COMMAND | open -f -a preview
Re:Command-line Fu by mseebach on Monday March 23, 2009 @07:45AM (#528385)
Cute. An artefact from a time when text was still written on the assumption that the primary consumption would happen through print.
Re:Command-line Fu by mechanical_fish on Sunday March 22, 2009 @06:00PM (#527524)
Looks a lot like Snipt, which I have been using:

http://snipt.net

Re:Command-line Fu by mpk on Sunday March 22, 2009 @07:44PM (#527655)
Never heard of snipt, but having just taken a look I have to say it does, at a first glance.

Snipt seems to be a more general code-snippet site, though whereas commandline-fu focuses solely on the command line.

While we're off on a mild tangent, check out dotfiles.org for collections of some cool unix rc files. It complements commandline-fu nicely.

Re:Command-line Fu by mdemare on Sunday March 22, 2009 @11:21PM (#527962)
They went for the terminal look, but some of us have dark on light terminals too! Finally a site where command-control-alt-8 comes in handy.

Great tips though, although not all of them work on OSX, and it does't advertise this. Love the !! command (runs previous command as sudo), had completely forgotten about it.

Re:Command-line Fu by chanux on Sunday March 22, 2009 @10:24PM (#527861)
Warning: This site may be addictive for some of you.
Re:Command-line Fu by mpk on Sunday March 22, 2009 @06:26PM (#527560)
Hm. The site admin uses the name 'root', which is generally frowned upon by the unix community...

(I kid! I kid! I'm taking it out of context! Don't flame me, bro!)

Cool site, picked up two gems after only about 20 seconds on the main page.

Re:Command-line Fu by willwagner on Monday March 23, 2009 @10:54AM (#528619)
While we're talking about the command line and bash, can someone recommend a decent book on the topic? I've been spending a lot of time these days on the command line grepping and chopping up our log files looking for trends and bugs, and I've suddenly realized how lame I am at the command line compared to many of my colleagues and how much faster I could be if I knew more of the ins and outs of bash.
Re:Command-line Fu by gcv on Monday March 23, 2009 @01:19PM (#528851)
I personally like "From Bash to Z Shell: Conquering the Command Line."

It focuses somewhat more on zsh (my shell of choice) than on bash, but one of the authors contributes heavily to zsh. Even so, bash users will see lots of great hints and tips. The shells' own man pages are more reference-style (see zshall), which I find heavy going when it comes to learning how to use the environment more effectively. The book explains use cases and provides examples in a way that makes the reference material more understandable.

Re:Command-line Fu by drsnyder on Monday March 23, 2009 @11:50AM (#528700)
Take a look at Unix Power Tools http://oreilly.com/catalog/9780596003302/.
Re:Command-line Fu by etal on Monday March 23, 2009 @09:55PM (#529569)
I like the O'Reilly book, Learning the Bash Shell:

http://oreilly.com/catalog/9780596009656/

I keep it on hand as a reference for shell scripting, since it's both thorough and fairly portable.

Re:Command-line Fu by ptn on Sunday March 22, 2009 @10:57PM (#527920)
That green they use is kinda hard on the eyes...
Re:Command-line Fu by jamesbritt on Monday March 23, 2009 @05:32PM (#529235)
This is pretty subjective, but the green/white text on black makes it unreadable for me.

I have a 'zap colors' bookmarklet that fixes it for me, but you may want to consider whether the color choice (albeit cute) is most effective.

Re:Command-line Fu by enduser on Sunday March 22, 2009 @11:03PM (#527933)
curl http://www.commandlinefu.com/commands/browse 2>/dev/null | grep '="command"' | perl -pe 's#</?div.*?>##g' | bash
Re:Command-line Fu by spkthed on Monday March 23, 2009 @01:40PM (#528885)
osx/Linux ssh-copy-id replacement:

cat ~/.ssh/id_rsa.pub | ssh 'ip/port/options' "cat >> 'home directory'/.ssh/authorized_keys"

Re:Command-line Fu by nailer on Monday March 23, 2009 @05:45PM (#529259)
ssh-copy-id is already part of OpenSSH, which is part of OS X / Linux. It also sets file and directory modes properly.
Re:Command-line Fu by spkthed on Monday March 23, 2009 @08:47PM (#529486)
It's a script that comes with most distros, but, not with Leopard by default at least. You probably could add it, but, it's a simple command either way and not everyone can add scripts like that.
Re:Command-line Fu by known on Monday March 23, 2009 @02:43AM (#528171)
man -k a e i o u