What would you recommend me to use: 7zip, xz, gzip, tar, etc which is more or less available on the most linux distributives and what does compression the best?
closed as primarily opinion-based by Wildcard, jasonwryan, G-Man, GAD3R, steve Nov 12 '16 at 9:43
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
I first want to clarify that of the list you provided,
tar is the only one that is not a compression algorithm.
tar is short for Tape Archive, and is used to create archive files. In short, a single file that consists of one or more files.
In terms of availability,
7zip is widely available across UNIX (Linux/BSD/MacOS) and Windows systems. Therefore a
zip file is highly portable. Tools to compress/decompress
gzip files are also available on Windows systems, but are more commonly seen and used on UNIX systems.
7zip are known to have a better compression algorithm than
gzip, but use more memory and time to compress/decompress. This topic is nicely discussed here.
I would recommend using
gzip when less memory is available, and compression/decompression speed is a concern.
xz can be used when space is a concern and compression/decompression speed is not.
Some nice benchmarks on these algorithms can be found here. Note:
LZMA is the compression algorithm used by
Just use tar with gzip a la
tar -czvf <filename.tar.gz> /path/to/files
Very often the difference in compression algorithms is either negligible (e.g. bzip2) or is dependent on what kind of data you are talking about. For general-purpose compression, the best advice I think is just to stick with what is standard.
Also it just makes life easier to use the same formats as everyone else unless there is a clear and significant advantage. So you'll want to get used to just using tar with gzip (as above) and also ZIP because you'll find a lot of those available as well.