How do I use 7-Zip CLI for Windows to create .tar.gz archives?
How can I use the 7-Zip CLI (7za.exe) on Windows to create .tgz archives, as I use tar zcvf archive.tgz source_files
on Linux?
Solution 1:
Now Windows supports a native tar command:
tar -cvzf output.tar.gz input_dir
https://techcommunity.microsoft.com/t5/containers/tar-and-curl-come-to-windows/ba-p/382409
Found it here.
Solution 2:
If you'd like to do it in a one-liner:
7za.exe a -ttar -so -an source_files | 7za.exe a -si archive.tgz
The -an
switch tells 7-Zip not to parse the archive_name command line parameter that's normally required.