Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-25-2008, 04:20 PM   #1
LQ Newbie
Registered: Sep 2008
Posts: 7

Rep: Reputation: 0
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.


Old 09-25-2008, 04:31 PM   #2
LQ Newbie
Registered: Sep 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Found it

zcat sourcezipname | egrep -i 'pattern' >test.out



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does zgrep unzip a file then grep it? bonz78 Linux - Newbie 3 08-05-2008 10:41 AM
zip files cooldudeguy Linux - Software 2 10-24-2004 02:57 AM
*.zip files e1000 Linux - Software 2 12-30-2003 10:40 AM
Zip Files linuxsoundprob Linux - Software 8 08-26-2003 06:34 AM
.zip Files Wynd Linux - Newbie 4 08-01-2001 12:47 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:03 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration