RC Logr 20200730 113444
Thursday, 30 Jul, 2020
If you make a mistake and enter sensitive information in your zsh prompt, it is saved in history. Since you do not want that info sitting around in a plain text file, simply edit $HISTFILE to get rid of the offending line, then use fc -R to reload the history file. 😎
A couple of tips:
- zsh history is often kept in
~/.zsh_historybut that path can be confirmed by doingecho $HISTFILE. - your
~/.zsh_historymight be massive, butvimcan load it without trouble. Assuming you havevim, open the history file withvim ~/.zsh_history, pressesc, then useshift + Gto jump to the end of the file. Delete the offending line withDthen save with:wq. - if you confirm with
historyit will show the unneeded line still, so do thefc -Rto reload the history file you just edited and saved.