Juicy lil' bytes

Execute Your Last Command With a Sudo Prefix Using a Bang Command

Need to re-run that last command with sudo? Check out this idiom.

The !! Bang Command

In your shell, the bang command !! re-runs your last command. If you need to re-run it with superuser privileges, you can prefix the !! bang command with sudo and go.

sudo !!

No need to type sudo after using the up arrow and then navigating to beginning of the line. It’s a simple, time saving maneuver.

Source: softpanorama.org