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".
[ Parent
| on HN ]
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