7

I've got ~50 zip files, each containing a similar directory structure but with different files inside.

Is there a way I can easily dir the contents of those zips?

I'm interested in creating a list of all the files with their relavite paths, such as a/b/c/file.txt

4 Answers 4

5

Download the command-line version of 7-zip (7za) and do a 7za -l. This will list the contents of the file. You can then, of course, put this into any kind of batch script.

1
  • 2
    The 'l' is a command, not a switch, so the correct invocation is "7za l your_archive.zip" Oct 1, 2018 at 13:49
4
  • Info-Zip's UnZip (in zipinfo mode):

    unzip -Z1 foo.zip
    zipinfo -1 foo.zip
    

    More information:

    unzip -Z foo.zip
    zipinfo foo.zip
    
  • 7z:

    7za l foo.zip
    
4

If you have jdk you can try jar:

$ /cygdrive/c/jdk1.6*/bin/jar -tf tcpmon-1.0-bin.zip
tcpmon-1.0-bin/
tcpmon-1.0-bin/apidocs/
tcpmon-1.0-bin/apidocs/org/
tcpmon-1.0-bin/apidocs/org/apache/
tcpmon-1.0-bin/apidocs/org/apache/ws/
tcpmon-1.0-bin/apidocs/org/apache/ws/commons/
tcpmon-1.0-bin/apidocs/org/apache/ws/commons/tcpmon/
tcpmon-1.0-bin/apidocs/org/apache/ws/commons/tcpmon/class-use/
1
  • will this work with wildcards? e.g., *.zip ? Oct 31, 2017 at 14:58
0

in windows ,install 7zip then open the app path,make "7z.exe" shortcut to the zips folder ,input command to the .bat file:

for /f %%i in ('dir /b *.zip') do 7z.lnk l "%cd%\%%i" >>mylist.txt

#that is a basic function for current folder path only

#use other extension just change ".zip" example: ".7z" .....

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .