4 ms·
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 li
by sketerpot 17y ago
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".
- chronomex 17y agoIt 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
- deleted 17y ago[deleted]