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?

link|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
feedback

2 Answers

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

link|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
feedback

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).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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