6 ms·
Prefix the whole command with a space to avoid dumping your password into your bash history: " grep `echo -n yourpassword | shasum | cut -c6-40` SHA1.txt"
by olifante 14y ago
Prefix the whole command with a space to avoid dumping your password into your bash history:
" grep `echo -n yourpassword | shasum | cut -c6-40` SHA1.txt"
- prakashk 14y agoOnly if HISTCONTROL is assigned 'ignoreboth' or 'ignorespace'.
- rasengan 14y agoI couldn't really find a good reason to use a .bash_history. I linked mine to /dev/null and never looked back. (heh)
- pbhjpbhj 14y agoCtrl+r history search? I'd tend to maintaining a complete history log so that when I've forgotten the one liner I used to rotate my videos 2 years ago I can easily recall it.
- verself 14y ago2 years? Just how big is your history file? I thought 16k entries might be reasonable but that doesn't even last 3 weeks for me. I think there might have been some issue with slow disk seeks so at some point I restricted it to that many. I guess it probably it would be better to regularly backup the history file to deal with possible some accidental truncations and issues when running multiple shells concurrently, but probably the overall effort to set up such a system would outweight the benefits.
- uselessuse 14y agoexport HISTSIZE=0
- uselessuseof 14y agoexport HISTSIZE=0
- peterwwillis 14y agoAlternative and more dramatic method of preventing it being written to your bash history: kill -9 $$
- bmnbug 14y agokill -9 -1 is better than kill -9 $$
- alanh 14y agoHow so?
- mcpherrinm 14y agoThat post was a troll. -1 is a special PID: It indicates that all processes that you can kill should be. Kill -9 -1 as root is a surefire way to make a system stop doing anything, fast.
- unfletch 14y agoOr prompt for it: grep `read -sp "password: "; echo "$REPLY" | tr -d "\n" | shasum | cut -c6-40` hacked.txt