1

I'm trying to grep my repo searching for @ sign to find some e-mail addresses because of this git issue.

I type grep -rnw '/my/path' -e '@' into the terminal and I get:

enter image description here

Why does it happen?

P.S. I think there is no sensitive information in the picture, but someone please tell me if you think there is.

adamczi
  • 343
  • 1
  • 7
  • 24

1 Answers1

0

If you have issues only on files within a .git folder, you might consider excluding it from your recursive grep, as in this answer.

grep --exclude-dir=".git" -nrw ...

On CentOS, the regular grep might not include that option though.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • But it's searching inside .git folder what I actually need to do to find any emails in config. – adamczi Nov 29 '17 at 10:33
  • @adamczi in config? Then you would need only to grep `.git/config`, not all `.git/` subfolder content. – VonC Nov 29 '17 at 11:57
  • That's correct. I could acutally exclude `.git/object`, as I can see it may cause troubles. But it doesn't explain why it crashes my terminal and (here in case of ssh login) I have to quit session, exit terminal and run it back again. – adamczi Nov 29 '17 at 12:01
  • 1
    @adamczi In case of an ssh session, it is probably because the tty cannot handle special characters (as in https://unix.stackexchange.com/a/79686/7490) – VonC Nov 29 '17 at 12:02
  • thanks a lot! I couldn't google it, but it seems it has already been discovered and answered. I have to try `stty sane` + `tput rs1`. – adamczi Nov 29 '17 at 12:12