how to see command history in linux code example
Example 1: find old command terminal
history | grep "foo*"
Example 2: linux history command
Just check the enumeration of your commands history and then delete them:
history -d 7 #Deletes seventh command in your history list