Zip files without compression
Mia Lopez
I'd like to bundle a number of big files into a single file, to make them easier to share. The files are already compressed (eg. jpeg, video etc), so I don't need compression, only archiving. How can I put them in a zip file without using zip's compression feature? I don't want to waste time trying to compress gigabytes of already compressed files.
I want to use zip and not tar file because many Windows users can't open those files.
8 Answers
The ZIP format has always supported archiving files with zero compression ratio, even since pkzip/pkunzip in DOS times.
Nowadays, almost all compression programs support this; 7-Zip is one of them, it lets you specify the compression ratio both from the GUI and from the command line, and it's free.
3For Linux this shell command zips mydir folder with no compression:
zip -0 -r mydir.zip mydir If you are using WinZip
Go to the "Settings" ribbon, and look for the "zip" group:
After that, drag the files you want to zip, into the file area.
A popup shows that the files have not been compressed in size:
Info-ZIP's zip, which is open source, free, and already installed on most Unixish systems has a "-0" option to store only.
Also if you simply zip with any zipper and the entries would be shorter stored than compressed, which is what happens with already compressed files, then they will be stored automagically. However if you already know they're compressed, then it's faster to just tell zip to that with -0.
Right click on all the files you want to zip, from the menu go to "send to" then click "compressed file".
4Almost all modern compression tools detect if files are already compressed, and chose not to compress such files.
You can also use B1 Free Archiver - it supports zip format perfectly. After clicking on "Create archive" just hit the button "More options" and choose "Store". It only stores the files as a single file without compressing them.
Using the zip command, you can supply a specific list of extensions to store without compression. That way you don't waste time (re-)compressing your media files, but you still get the benefits of compression for raw files in the same archive.
The flag is -n, and it takes a colon-separated list of extensions. E.g.
zip -n .gz:.mp4:.jpg -r mydir.zip mydirThere is a default list of stored files; according to the man page on my linux box:
By default, zip does not compress files with extensions in the list .Z:.zip:.zoo:.arc:.lzh:.arj
You can also specify a new default list using the ZIPOPT environment variable. E.g., under bash:
export ZIPOPT="-n .gz:.mp4:.jpg:.zip:.gif"To completely disable this behaviour, including the default list of extensions, use an empty list consisting of a colon: zip -n : -r ....