[Ilugc] grep zip files without unzipping

  • From: s.selvamsiva@xxxxxxxxx (S.Selvam)
  • Date: Wed Jun 17 15:50:15 2009

On Wed, Jun 17, 2009 at 2:24 PM, Anu-Linux <linuxdassa@xxxxxxxxx> wrote:

Hi,

Did you try unzip command?

$ unzip -l zipfile.zip

will show you the contents of the archive without extracting it.

$ unzip -l zipfile.zip | grep JPG

will show you all the JPG files inside that archive.


Thanks for your reply,I did it for recursive grep based on your suggestion
as shown below,

for file in *.zip ;
do
    unzip -l $file | grep -ir  jpg
    if [ $? = 0 ]
     then
      echo $file
   fi
done




HTH.

Cheers!

On Wed, Jun 17, 2009 at 2:08 PM, S.Selvam <s.selvamsiva@xxxxxxxxx> wrote:

Hi all,

I have to list zip file which contain jpg files.I tried to use
  zgrep -i *.jpg *.zip,
but,it does not produce expected results.Googling helped me a very
little.
I welcome your suggestions.
Note:Preferably,I dont want to unzip before serching as it contains large
set zip files.

--
Yours,
S.Selvam
_______________________________________________
To unsubscribe, email ilugc-request@xxxxxxxxxxxxx with
"unsubscribe <password> <address>"
in the subject or body of the message.
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc




--
??????????? ??????.
D. AnuradhA
Step to the future with FOSS!

My Blog : http://blog.mihikatha.net/
????? blog ?????: http://anuradha-life.blogspot.com/
My Photo Galleries : http://www.flickr.com/photos/dasun
http://picasaweb.google.com/linuxdassa
_______________________________________________
To unsubscribe, email ilugc-request@xxxxxxxxxxxxx with
"unsubscribe <password> <address>"
in the subject or body of the message.
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc




-- 
Yours,
S.Selvam

Other related posts: