Follow

so i just tried to guess wether how to gzip a directory ... i now have a directory with thousands of files as before... except that they are all gzipped individually 😅

@milan gzip only does individual files. Tar does multiple files but doesn't do compression. That's how we invented the gzipped tarball. (tar has a gzip flag)

tar zcf name.tar.gz directory/

z: gzip-compress the output
c: create archive (versus x:extract, t:test)
f: write to the named file instead of stdout

@milan Oh, and also by default gzip replaces the original file with the gzipped version which isn't always what you expect

@milan I should clarify, when I say "tar doesn't do compression" I'm referring to the tar format; the tar tool DOES do compression, but only by gzipping the actual tar file. .tar.gz is a very common format for distributing source code in Linux.

Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!