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
It makes a tar archive before compression.
.tgz is a shorthand for
.tar.gz, which is equivalent to first making the
tar -cf somefile.tar some/path/to/dir, and then compressing that with