11

I'd like to see the absolute size in bytes of each file that has been compressed into single zip file. Having read the zip man page, I'm not sure that that utility can do it. This is on Mac OS X.

Something like:

$zip list myarchive.zip

file1.jpg 100 bytes compressed 3000 bytes uncompressed
file2.jpg 130 bytes compressed 3440 bytes uncompressed
16

You can use the unzip utility with the -v flag:

unzip -v files.zip

Archive:  files.zip
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
       0  Stored        0   0% 11-23-2011 15:02 00000000  file1
       0  Stored        0   0% 11-23-2011 15:02 00000000  file2
--------          -------  ---                            -------
       0                0   0%                            2 files

Note: The file sizes here are 0 because I made test files of zero length.

6

Doesn't unzip -l somefile.zip do exactly what you want?

3

unzip -l gives uncompressed files size and -v lists archive files verbosely, adding to the basic -l info the compression method, file's compressed size, compression ratio and more.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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