Things like "sudo !!" are INCREDIBLY dangerous, and I would never put that on a cheat sheet.
Things like "sudo !!" are INCREDIBLY dangerous, and I would never put that on a cheat sheet.
Or put in a slightly nicer way - Blindly running commands is going to turn into a learning experience, don't do it on a production machine.
If you have lots of jitter and lag, i suggest using Mosh which I've found to be amazingly awesome when using it on Amtrak's spotty free wifi (3G uplink).
$ rm -rf /root
rm: cannot remove `root': Permission denied
$ sudo !! # Does not run this, but returns the line below.
$ sudo rm -rf /root # Then you say, "Wait I dont want to do this." $ rm -rf /root
rm: cannot remove `root': Permission denied
$ sudo !!
sudo rm -rf /root
# /root is now kaput user@host$ less /var/log/syslog
Permission Denied
crap... $ sudo !!
sudo less /var/log/syslog
Woo!Obviously, this doesn't help when using Fabric or scripting, but you shouldn't need "sudo !!" in those scenarios.
If and only if you meant to do that, you're fine.
Hopefully if you're in a NOPASSWD user/group, you know what root can do if you're careless; if you're not, there's yet another point where you'd have go out of your way to do damage with this shorthand.