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
2
u/QuantumCow May 17 '11
Also
will show you the past 5 commands in your history which avoids being overwhelmed with text. Obviously that works with any number, not just 5.