linux remove command from history code example
Example 1: delete command from history
Just check the enumeration of your commands history and then delete them:
history -d 7 #Deletes seventh command in your history list
Example 2: how to delete command from terminal history
## Delete the bash history entry at offset OFFSET ##
history -d offset
history -d number
history -d 1013