tar ❤️ gzip

These 2 examples show tar+gzip operating on a directory.

You can use tar+gzip on multiple files in the same way. I just didn’t show it.
(Beware of tarbombs!)

Archiving then compressing

tar -cvf - <dir> | gzip --best > '<dir>.tar.gz'

Decompressing then unarchiving

gunzip --to-stdout <dir>.tar.gz | tar -xvf -

Opinions expressed in these articles do not represent those of my employer.