How to delete a specific command history and when you enter that "command" that will delete the specific command?
For example, here is my history:
1 ls -l 2 cat > foo.txt 3 ifconfig 4 echo "Hello"
Now, I want to delete the
ifconfig command history which is Number: 3, so I'll do the following command:
history -d 3 ( which will delete the ifconfig command).
The second one is, I want to delete that command I recently typed
(history -d 3) or in other words, this command will not be remembered in history, so no one can see that I just deleted a specific command history.
To summarize, the
ifconfig command history will be deleted and the recently type
history -d 3 command will not be remembered/logged in history.