Most software, when not in a package such as .deb
, comes in .tar.gz
or .tar.xz
. Is it necessary to use tar
before using xz
or gz
? What are the advantages of doing that?
Asked
Active
Viewed 321 times
0

circl
- 121
- 8
-
Do you know what `tar`, `gz` and `xz` is? – tkausl Apr 29 '20 at 12:09
-
Yes. `tar` is an archive with no compression (Tape ARchive), and `gz` and `xz` are archives with compression. – circl Apr 29 '20 at 12:10
-
`gz` and `xz` are not archives, they are _just_ compression. Combine tar and gz and you get an compressed archive. – tkausl Apr 29 '20 at 12:14
-
They can only store one file? When compressing something like a log file you don't need to use tar. – circl Apr 29 '20 at 12:16
-
They don't _store_ anything, they just compress a stream of bytes. – tkausl Apr 29 '20 at 12:22
-
That means they automatically use tar when you provide a file in the command. – circl Apr 29 '20 at 12:25
1 Answers
1
If you want to combine several files - use tar
and then, optionally, compress your tar
archive with gzip or another tool. If you have 1 file only - using tar
is meaningless, just compress the file with gzip

Andrey Khoronko
- 653
- 3
- 6