How to minimize the time for Unzipping & zipping the files in Unix? How to minimize the time for Unzipping & zipping the files in Unix? unix unix

How to minimize the time for Unzipping & zipping the files in Unix?


Try the silent mode -q when unzipping. This will reduce the time by a lot if there are too many files in the archive, since unzip writes the names to stdout.

man unzip:

   -q     perform  operations  quietly  (-qq  = even quieter).  Ordinarily          unzip prints the names of the files it's extracting or  testing,          the extraction methods, any file or zipfile comments that may be          stored in the archive, and possibly a summary when finished with          each  archive.   The -q[q] options suppress the printing of some          or all of these messages.


If disk space is not an issue, then simply don't ever compress. Then you'll never need to decompress either.

You can try pigz to speed things up if you have multiple cores. It is a parallel implementation of gzip that will especially speed up compression.

I don't understand why your decompression is so slow compared to your compression. It should be about a factor of three to ten faster. Can you provide the actual code for what you're doing? There must be something wrong there.

By the way, your terminology is incorrect. zipping and unzipping refer to the .zip format, not the .gz format. You would just say that you compress to and decompress the gzip format.