3 ms·
If you care about your command history, I would advise against doing this unless you are truly a sed expert: $ sed -i '/secret-command/d' $HISTFILE # dele
by usefulcat 7y ago
If you care about your command history, I would advise against doing this unless you are truly a sed expert:
$ sed -i '/secret-command/d' $HISTFILE # deletion of history line containing 'secret-command'
Because if you get it even slightly wrong, you could easily hose your entire history. If it were me, I would just use an editor to delete that line (or two, if timestamps are enabled).
- wazzaps 7y agoAnd if you know don't want a command in your history, prefix it with a space.