Sign up ×
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 a 7-Zip archive (.7z) without having to unpack the archive. I have many 7-Zip 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

4 Answers 4

On Windows, use a command prompt:

cd C:\Program Files\7-Zip

To search for a specific file, e.g. namefile:

7z l compressed.tar namefile -r

Video tutorial: Search files with 7-Zip

share|improve this answer
Yes, this works, and it is quite fast, especially if there is not a lot of matches. But the folder where 7z.exe lives must be in PATH, for example C:\Program Files\7-Zip. However, it does not search the content of files, only the file names and thus does not answer the question. –  Peter Mortensen Mar 19 at 10:01

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

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

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

share|improve this answer

Your Answer


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.