Zip stored 0%, should I be worried?

I use zip to archive a large number of files. There are several files that I have small (they contain only one decimal number stored on one line). After working with these files, zip reports stored 0% . Not deflated 0% , but stored 0% . I am wondering if this means that in my subsequent zip archive these files will not be saved. If so, can I fix this, so will zip save them? Is it because the files are so small?

+6
source share
2 answers

When zip add the file, it compresses it if that makes sense.

If the file is large enough, zip will use the DEFLATE compression DEFLATE (and print "deflated" and% received with compression).

For very small files, compression will make the result larger (for example, if I manually deflate a file with 2 bytes, I will get 4 bytes), so zip solves them STORE (without compression): it prints "stored" and 0%, because it is "compression "did not resize. zip will also have STORE folders (no content).

You can easily play with compression: zip -0 will STORE everything, zip -1 to zip -9 will change the DEFLATE compression level and zip -Z bzip2 will change the compression method.

So, to answer your question: stored 0% is fine! A file has been added but not compressed.

+16
source

Do you run zip with recursion option?

 zip -r output.zip folder 

Without -r , zip will not compress under subdirectories and will result in 0% deflation.

+6
source

All Articles