Unix History Commands

To see this history listing, enter the command "history" or "fc -l". You should see a display like this one.

1 vi test.txt
2 more test.txt

Using "history" or "fc" to repeat commands

       Form           Example       Explanation
      -------         -------       -----------
       !n             !11           repeat event 11
       !-n            !-2           repeat the command entered 2 events
       !alpha         !vi           repeat the most recent command beginning with "vi"
       !!             !!            repeats command

Search Command History

fc -l 1 | grep word

Use the editor vi to edit and execute the command

fc -e vi [command number]