fc: fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]

Display or execute commands from the history list.

fc is used to list or edit and re-execute commands from the history list. FIRST and LAST can be numbers specifying the range, or FIRST can be a string, which means the most recent command beginning with that string.

Options
-e ENAME select which editor to use. Default is FCEDIT, then EDITOR,

then vi -l list lines instead of editing -n omit line numbers when listing -r reverse the order of the lines (newest listed first)

With the `fc -s [pat=rep ...] [command]' format, COMMAND is re-executed after the substitution OLD=NEW is performed.

A useful alias to use with this is r='fc -s', so that typing `r cc' runs the last command beginning with `cc' and typing `r' re-executes the last command.

Exit Status:
Returns success or status of executed command; non-zero if an error occurs.