Rick Cogley's Tech Logr

Short Technical Laser Bursts %%

RC Logr 20190322 072545

Friday, 22 Mar, 2019

Ever boneheadedly pasted a password into a terminal command? Restart your terminal, find your history file with echo $HISTFILE, edit it and delete the offending line, then reload. That should do it. 🏁

More options:

You can delete all lines with a specific string from your history file using sed -i '/badstring/d' $HISTFILE.

Add the zsh builtin option setopt histignorespace to your ~/.zshrc. Now if you enter a single space before a command, it will not be logged in history.

RC Logr 20190322 072545 - Ever boneheadedly pasted a … Rick Cogley
Back to Home Tweet Link