The history command
Display or manipulate the history list. 8 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.
Options in the examples
-c- clear the history list by deleting all of the entries -d offset delete the history entry at position OFFSET.
Examples
history | grep ssh
history | tail -20Last 20 commands
history | awk '{print $2}' | sort | uniq -c | sort -rn | head -10
historyAll history
history 20Last 20 commands
history | grep apt
history -cClear current session history
history -d 100Delete entry 100