0

What is the difference between .tar.gz and .tar.xz (is there more?)? I know that you can just open up Archive Manager and extract them. But what is the actual difference? Which should I use? What flags should I give tar to extract them in CLI?

EDIT:

What is the difference between the xz algorithim and the gz algorithim?

NoOneIsHere
  • 199
  • 4
  • 16

2 Answers2

3

The .tar (standing for Tape ARchive) files are the ones created by the tar utility. It is capable of putting several files in one single package, but it can't compress them. That's where the .gz, .xz and .bz2 extensions enter. The gz format provides the best speed but a "regular" compression ratio. The bz2 format provides a mid-term between speed and compression, while xz is excellent when talking about compression but a little slower.

The big difference between .tar.gz/bz2/xz files and .zip/.7z/.rar files is that the "tar" ones pass through two processes to reach their final forms while the others do it in a single step.

Eduardo Cola
  • 5,817
1

Tar allows you to pack multiple files into a single file, while the other extensions (gz, bz2, xz, lzma, etc.) are the compression types. Specific to your question, .gz compression is the fastest and largest, while .xz is much slower and more effecient.

According to this question from 3 years ago, tar can recognize and extract the files without any special flags.