Bash Built-In Commands
http://linux.about.com/library/cmd/blcmdl1_fc.htm
fc
Fix command. Run
fc
and it will open an editor with the last command, and then run it on exit.