Q: Add "sudo" to the last command line in bash I run a command, then realize it should have been run with sudo.  
In zsh I have a function so that I can hit a ^x^x and it will grab the previous line from the history and prepend sudo to it, so I can run it again.
Is it possible to do this with bash?

A: As mentioned by Gerald Schneider, this is a duplicate that exists on Stack Overflow, but since it doesn't exist on Serverfault, and it won't let me mark it as duplicate, I'll just put the answer here as well.
From jm666 question here

You can write:
sudo !!

(See §9.3 "History Expansion" in the Bash Reference Manual.)


A: Most bash implementations I have used allow command-history navigation via the up- and down-arrow keys.
So in addition to @trueCamelType's solution, one could also use:
<up-arrow><home>sudo<space><enter>

Eight characters, either way.  :)
