fc — Process the command history list.Summary:
FC utility used to fetch the commands from the shell command history to list, edit and re-execute. The order in the history may differ due to the number. So FC will list the commands based the time, due to this, irrespective of the number, order will maintained. NOTE: Some of the examples will try to re-execute your commands. So use it very carefully. Examples:
$ fc -- Open the last command in a editor for editing. The modifiedcommand will executed once you exit the editor. $ fc -e emacs -- Same as above. But open it in my favorite editor. $ fc -l -- Only list the commands. $ fc -l 20 40 -- List only commands from 20 to 40. $ fc -lr 20 40 -- List it in reverse order. $ fc -ln 20 40 -- Don't show the numbers in the output. $ fc 20 40 -- Open for editing and on exit, execute the commandsone by one. $ fc -s 20 40 -- Re-execute the commands with-out opening forediting.
Read: man fc