Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For the lazy:

  grep -i <password> 10-million-combos.txt


for the paranoïd lazy

    export HISTCONTROL=ignorespace
     grep -i <password> 10-million-combos.txt
(type a space before the command for it not to be logged in the history)


Just because you're paranoid doesn't mean the eyes above your ï aren't watching. Although, it might mean you're delusional.


And then history -c


... 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).


For the lazier, -i means case insensitive.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: