The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

history - Reviewing Command History



To find out the commands you've previously entered, you can view the file reported by echo $HISTFILE. The history command reads this file to list the commands you've issued before.


Some common options for the history command include: Example:
$ history ←Query previously entered commands
    11 mv pro1 pro2
    12 cp /dev/null file.txt
    13 vi file.txt
$ !12 ←Execute command with number 12

For more detailed option, please refer to the provided link