I have a directory hierarchy that contains numerous
.gz files. I want to be able to recursively grep them for the string "foo". From what I've read online the following should work:
zgrep -R -H "foo" .
However, this never returns any results. If I replace the dot with the name of a file it does work. For example,
zgrep -R -H "foo" myFile.gz
however, obviously, this no longer will be recursive.
I know "foo" is in some of the files because the following command returns many results:
find . -iname "*.gz" | xargs zgrep "output" | less
Does anyone know why my recursive zgrep command is not working. I'm on a RHEL linux box