LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-27-2011, 04:15 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
Using zipgrep


Hi all,

I've a zip-file and the file "jax-ws-catalog.xml" is inside. But as I use the zipgrep to search this file with
Code:
zipgrep "jax-ws-catalog.xml" myzip.zip
Nothing is shown.
 
Old 09-27-2011, 03:14 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
To start with, recognize that *nix-based applications generally follow the policy of "no news is good news"; that is, when you see no output it usually means that the operation completed without error. The program did everything it was designed to do, and any failure you experience is likely due to PEBKAC.

I don't have any experience with zipgrep in particular, but it appears to be just a wrapper script for unzip and grep. And when grep gives no output, it usually just means that it found no matches for the pattern you gave.

It appears, however, that you are simply misunderstanding the function of zipgrep. It appears to be for searching for text strings inside the files contained in the archive, not for searching the filenames it contains. Note that the command syntax is:

search pattern + archivename + optional list of filenames to search

Your command is therefore searching for the literal text string
"jax-ws-catalog.xml" inside all the files in the myzip.zip archive. Since none of the files contains that text, the command outputs nothing.


Use the zipinfo program instead if you want to see what files the archive contains.

Code:
zipinfo -1 myzip.zip "jax-ws-catalog.xml"
Note that the last, optional argument is a globbing string to match. You could use "*catalog*" for example, to locate all files with "catalog" in their names.
 
  


Reply


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



LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:39 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