Fix Command
fc is a shell builtin command that lets you do some cool stuff with your shell history.
Run it without any arguments, and you can edit the previous shell command in your text editor of choice1. To run your freshly-edited command, just save and quit.
fc -l returns a numbered list of recent commands (just like history).
fc followed by one of those numbers will open that command in your editor.
If you follow fc with a string, it’ll open up the last command starting with that string—eg. fc mpl will open the last mplayer command.
That’s just the basics—you can do all sorts of crazy command editing gymnastics with fc, but the details vary from shell to shell. For details, see: bash, ksh and zsh.
Thanks, @gummo!