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:
-c:Clear all command history records.
-d n:Delete the history record with number "n".
-a:Append the current command to the history for immediate retention, rather than saving it after exiting the shell.
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