How do I create a ".tar.gz" file using 7-Zip on Windows?


On Linux, I would simply run:


Code:
$ tar cfz archive.tar.gz folder
When using 7-Zip on Windows, this process is a little bit more complicated.


As a GZIP compressed archive can contain only one file, 7-Zip won't offer you GZIP compression if you try to compress a folder or multiple files at once. When you choose TAR, you can't select any compression algorithm.

7-Zip - Creating a tar.gz file - Part 2

The trick is, that you have to create a TAR archive first. You can then put that single TAR file into 7-Zip and it will finally offer you the ability to compress that file using GZIP.


The result is an archive with the .tar.gz extension which is exactly what you wanted to do.


That's another example how something that needs several mouse clicks on Windows needs a single line on a Linux shell.

Now because .zip files are very common that it can be compatible with most other Operating Systems, but older zips that have been compressed with very old Compression File tools had some bugs and compression errors way before 2003.

However it maybe wise to at least compress files for a specific OS - like for Linux files only (that doesn't contain Windows only binaries or apps as .dll or .exe) compress them as tar.gz. Otherwise for Windows, compress them as .zip.