I recently made a 10.5GB file of all zeroes, and started zipping and duplicating it, similar to a zip bomb. The compression per-layer was:

  • 1st layer (the 10.5GB file): very high compression (about 35MB)
  • 2nd layer (64 zipped raw files): very high compression (about 6MB)
  • 3rd layer (64 zipped 2nd layer files): very high compression (about 5MB)
  • 4th layer (64 zipped 3rd layer files): moderate compression (about 105MB)
  • 5th layer (64 zipped 4th layer files): Unknown error

This was from using Linux's zip program.

Is there a limit to the compression of .zip? From attempting to create the 5th layer, it seems like there is one.

  • 1
    More likely you hit a filesystem or OS limitation. – Ignacio Vazquez-Abrams May 18 '18 at 20:48
  • what is the "raw file"? – Attie May 18 '18 at 20:49
  • 1
    what do you mean "is there a limit"? Are you asking if there is a limit to zip-within-zip? To total archive size (compressed / plain)? – Attie May 18 '18 at 20:50
  • I also struggle to believe that 64x 6MB files compresses to 5MB - A) zipping a zip file isn't going to achieve much as the data is already compressed (making it hard to compress further) B) even with good de-dupe, you're looking at a minimum of "6MB + a bit" – Attie May 18 '18 at 20:51
  • Please also share the commands you are running for each step. – Attie May 18 '18 at 20:52

There is no limit. Sadly, zip-on-zip does not generally produce smaller files. Your particular case of an all zero file is an unusual exception. It wouldn't work on 10gb of random or "typical" file data for example.

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.