Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
share|improve this question

3 Answers 3

up vote 7 down vote accepted

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

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.