News for hackers. Stuff that matters.
Re:Top Ten One-Liners from CommandLineFu Explained by sketerpot on Thursday March 18, 2010 @02:53PM (#1202141)
When I need to do number one -- add sudo to the previous command -- I just use the up arrow, Ctrl-a to get to the beginning of the line, and add sudo. It's a little slower than the method in the article, but I find it downright dangerous to have something in your command history that means "do whatever was typed previously as root".
Re:Top Ten One-Liners from CommandLineFu Explained by chronomex on Thursday March 18, 2010 @03:54PM (#1202326)
It actually won't be in your command history as that. The entry will go into your command history as "sudo previous-line".Try it yourself:

  $ true
  $ echo !!
  echo true
  true
  [up-arrow to see]
  $ echo true
Re:Top Ten One-Liners from CommandLineFu Explained by sketerpot on Thursday March 18, 2010 @11:32PM (#1203313)
Nice! Consider my objection withdrawn, and my compliments to the developers of bash.
Re:Top Ten One-Liners from CommandLineFu Explained by vorador on Friday March 19, 2010 @09:27AM (#1204061)
I think in this case, the compliments should go to bill joy, the creator of csh.