Are tar.gz and tgz the same thing?

Viewed 70752

I created .tgz file with tar czvf file command.then I ended up with a tgz file. I want to know the difference between it and tar.gz.

5 Answers

You can unzip tar.gz or .tgz with:

tar -xzvf

and create with:

tar -czvf

It is absolutely the same

Short answer: there is no difference.

Long answer:

  • SunOS USTAR tar format: tar doesn't support inline compression from options (you can install gtar to have GNU version).
  • Linux POSIX tar (GNU) format: tar can archive and compress as well.

Generally speaking: the extension name will differ depending on how you create your outcome file:

# Archiving THEN compressing: from SunOS or Linux:

$ tar cf output.tar /path/to/archvieme/
$ gzip output.tar
# creates "output.tar.gz" file.

# Archiving AND compressing: people usually save on typing and go with .tgz rather than .tar.gz:

# works only with GNU tar:
$ tar czf output.tgz /path/to/archiveme/

# works on SunOS and Linux:
$ tar cf - /path/to/archiveme/ |gzip > output.tgz
Related