LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-25-2008, 04:20 PM   #1
tekvaio
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.

Thanks,

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

Original Poster
Rep: Reputation: 0
Found it

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

Thanks!
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:33 AM.

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