I have a large number of zip files that were compressed using the zip command. I would like to recompress them with the -9 flag to improve the compression ratio. Does anyone know if that can be done without manually decompressing and then compressing.PS. I need to keep them as zip files since they are served to windows users( and as such have white spaces in their names)
Compress zip files with higher compression
linux;zip;compression
You cannot improve the compression ratio, without decompressing the data. You don't have to extract all of the zip files before compressing them, but I would recommend uncompressing one whole zip file before re-compressing.It is possible to recompress the files in a zip file one at a time and re-adding them before going to the next file contained in the zip file. This requires N rewrites of the zip file for a zip file containing N files. It is much more efficient to extract the N files and generate the new zipfile in one go, compressing all files with -9.