Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am looking for a way to search the content of files inside of 7z archive without having to unpack the archive. I have many 7z archives with code inside them and I'd like to search them.

Is there a way to do that?

share|improve this question
    
What Operating System? –  Darth Android Aug 23 '11 at 5:12
    
ditto. Though from what i can tell, there's no working way to mount a 7z archive in filesystem in linux, which would allow him to use the usual *nix file tools to search. –  Journeyman Geek Aug 23 '11 at 6:05
    
@Martin: search for which criteria? name? bytes inside the files stored in the .7z? –  akira Aug 23 '11 at 6:12
    
OS: Windows; Criteria example: "my string" –  Martin Aug 23 '11 at 12:59
add comment

4 Answers

If you're on linux with 7-zip installed:
find . -iname *7z -exec 7zr -l \{\} \; | grep "filename.cpp"

share|improve this answer
    
That is still unpacking them. Although it is not possible to do what the OP wants without unpacking them, so... –  EBGreen Aug 23 '11 at 5:23
    
I'm in agreement with EBGreen. You gotta unpack them, unless you are ok with incomplete results. –  surfasb Aug 23 '11 at 5:38
    
Doesn’t that command just search for filenames? Martin wants to search inside the files themselves, not just their names. –  Synetech Aug 23 '11 at 5:43
add comment

As others have said, no there is no way. To examine the contents of a file, it needs to be unpacked (regardless of if the files are compressed solid or not or if they are encrypted or not). The only way that you can avoid having to decompress the files is if they are added with the store method (ie, not compressed at all, just globbed together).

share|improve this answer
add comment

In windows Use commad prompt :

cd C:\Program Files\7-Zip
7z

To search a specific namefile :

7z l compressed.tar namefile -r

VIDEO TUTORIAL : http://www.youtube.com/watch?v=mnIDopVXChY

share|improve this answer
add comment

Try out SearchInZipFiles: It is a simple Open Source Tool for Windows located on Sourceforge:

http://sourceforge.net/projects/searchinzipfiles/?source=directory

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.