Zgrep mulitple zip files
I've been stumped on this one for a bit, and I'm unable to find a solution.
What I'm trying to do is run a grep for a particular regex on a set of multiple zip files. Within each zip file there are multiple logs. For the most part these files all end with a log extension *.log. I have tried the following but had no results. zgrep -i 'expression' *.zip >outputfilename.OUT but won't find anything. After some research I'm seeing that I would only work with files that were compressed with GZ . And yes, I was successful with that. This makes me believe that I may need to decompress these files first then grep them. Would someone know if there an easier way without having to uncompress ? I'm starting to read a bit about zcat, but not sure if/how if this will be useful. Thanks, TV |
Found it
zcat sourcezipname | egrep -i 'pattern' >test.out
Thanks! |
All times are GMT -5. The time now is 01:05 PM. |