Remove a single sensitive entry from history

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the bash category.

Last Updated: 2024-11-23

One way is to edit ~/.bash_history directly (zsh: ~/.zsh_history)

A better way, on platforms that support it, is using the history command directly with the -d flag:

# Delete a range of history times
history -d 511-520