Hacker News new | ask | show | jobs
by flavor8 4142 days ago
And then history -c
3 comments

... which will clear your entire history, which you probably don't want.

I don't know a shorter way, but to delete one line from history, do 'history', which shows the line numbers, then 'history -d LINE_NUM'.

Or, in bash, prepend the command with a space and it won't go into history.

Open new terminal -> unset HISTFILE -> do your greping -> close terminal
Unless somebody did a ps while your grep was running...

Don't put sensitive stuff in CLI args!

Good point, how about

    grep -f - 10-million-combos.txt
    <password>
    ^D^D
Depending on your system and configuration, couldn't you prepend a space to the command to prevent it from being saved into your history?

edit: Looks like vacri mentioned this in a peer comment an hour ago. Whoops!

That works if you are using bash, but if you are, for example, using zsh, you would first have to run "setopt histignorespace" which would enable hiding lines prepended with a space in the history (it's off by default).