r/bashtricks • u/QuantumCow • May 17 '11
Execute previous command as root
If you type out a long command and forget to sudo it, it's a pain to type it out again. Instead:
sudo !!
13
Upvotes
r/bashtricks • u/QuantumCow • May 17 '11
If you type out a long command and forget to sudo it, it's a pain to type it out again. Instead:
sudo !!
View all comments
Show parent comment
3
u/ffreire Jun 01 '11
Most terminals follow Emacs key-bindings, i.e. you could use CTRL+A to get to the first character in the string, and CTRL+E to get to the last character in the string. Very handy stuff :]