Dan D.
Dan D.

Reputation: 8557

Result of tar -czf

I need to put the extension for the compressed file, either .tgz or .gz. But I don't know whether this command

tar -czf somefile.XXX some/path/to/dir

makes a tarball before compression, or all files in the directory are compressed first then they are tarballed up.

Should .tgz == .tar.gz, and .gz == .zip?

Upvotes: 1

Views: 2406

Answers (1)

Conrad Parker
Conrad Parker

Reputation: 844

It makes a tar archive before compression.

The suffix .tgz is a shorthand for .tar.gz, which is equivalent to first making the .tar with tar -cf somefile.tar some/path/to/dir, and then compressing that with gzip somefile.tar.

Upvotes: 2

Related Questions