How do I list the contents of a zip along w/ file sizes and compression ratio (or packed size) on osx w/ command line tools?

link|improve this question

74% accept rate
feedback

migrated from stackoverflow.com Sep 17 '10 at 3:47

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 5 down vote accepted

You have this tagged with both zip and gzip, but here's both. These are both pretty standard Unix tools, whic Mac OS X supports (as far as I know, anyway):

zip file: unzip -vl file.zip

Example:

[23:02:22] ~/Download $ unzip -vl lightbox2.04.zip 
Archive:  lightbox2.04.zip
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
       0  Stored        0   0% 03-10-2008 00:57 00000000  css/
    1648  Defl:N      647  61% 03-10-2008 00:57 c3b9f4d9  css/lightbox.css
       0  Stored        0   0% 03-10-2008 00:57 00000000  images/
      49  Defl:N       44  10% 04-07-2007 20:58 64aff4e0  images/bullet.gif
     222  Defl:N      213   4% 04-07-2007 20:58 10131ca6  images/close.gif
     979  Defl:N      916   6% 04-07-2007 20:58 0415e19c  images/closelabel.gif
     723  Defl:N      728  -1% 04-07-2007 20:58 f3abf2ca  images/donate-button.gif
...
--------          -------  ---                            -------
  244588            94624  61%                            20 files
[23:02:36] ~/Download $ 

gzip file: gunzip -lv file.gz

Example:

[23:03:55] ~/Download $ gunzip -lv mudlet.tar.gz 
method  crc     date  time           compressed        uncompressed  ratio uncompressed_name
defla 768774be Feb 14 22:44             2895270             6533120  55.7% mudlet.tar
[23:04:02] ~/Download $ 
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.