[SOLVED] What is the difference between a tar.gz and a tar.xz file ?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What is the difference between a tar.gz and a tar.xz file ?
I'm not sure what to do with .tar.xz files. Are they
the same as .tar.gz files ? How do you expand them ?
Do you still use tar ? Do they create their own
directories when they expand or do you have to first
create a directory and put the .tar.xz file into
the directory before expanding it ?
Do .tar.xz file have some kind of advantage over .tar.gz
files or is this another thing just to make life more
difficult ?
tar.gz and tar.xz both are compressed tar-files, but with different compression methods. tar.gz is compressed with the gzip compression utility, tar.xz with the xz utility. For the user there is no difference when extracting those files, both behave exactly the same.
the newer xz format compresses most code a bit better than gzip dose
other than that , not much differance
just a different compression tool
That's just flat out wrong. All of the xz files I've ever created are half the size of the corresponding gzipped files. However... gzip compression is *fast* and xz compression is mind-numbingly slow. (Linux kernel xz tarballs aren't half the size of gzip tarballs; only 1/3 smaller.)
So, use xz compression for "done once" long-term storage. Likewise, speedy gzip is used by the ODF since you open and close them regularly.
I'm not sure what to do with .tar.xz files. Are they
the same as .tar.gz files ?
As previously noted, the behavior is the same. The xz compression produces a slightly smaller compressed file, but the cost is up to four times as long to do it. Since disk space is cheap and time sitting in front of the computer is expensive, most people accept the standard, gz.
The xz compression produces a slightly smaller compressed file
For varying definitions of "slightly".
Quote:
Since disk space is cheap
But network bandwidth isn't. And disk space adds up. And computer cases are fixed size: you can only add so many spindles to the chassis and connect so many nodes to the PSU.
But that's of concern mostly to people who run servers.
Quote:
time sitting in front of the computer is expensive
What is this, MS-DOS? Windows 3.1?
Quote:
most people accept the standard, gz.
This is true, since it's Good Enough for Most Stuff, and comes built into OO.o/LO.
We are fortunate, though, to have the ability to choose the best compressor for the individual task at hand.
This is true, since it's Good Enough for Most Stuff.
Obviously those who run servers have different concerns that people who are new enough to be asking questions about the relative merits of space compression schemes. I can remember looking at a hard drive that cost $3000, and only stored 5 megabytes, but that was 1978. So yes, disk space is CHEAP. As to time, it has been my observation that people get antsy if a process takes more than a minute to run. So if your time is more valuable to you than disk space, then I maintain .gz is a good choice.
But choice is the essence of the FOSS movement. Once one knows the value and trade offs of the available options, one can always choose whatever works for them, without being concerned for what someone else says is "best."
Run your file manager, click on the archive, and your archive manager will start. If the archive just has a single folder, drag and drop it to the file manager window. If it's got several, go back to the file manager, create a folder, and extract into it. No need to mess around in the command line: that's what GUIs are for.
Most modern archive managers will see XZ compressed files the same as gzip compressed files. Compressing files to XZ could take significantly longer than gzip, or most other compression methods. Of course the resulting file size will be smaller than other methods. The good news is, decompressing XZ is usually as fast as decompressing other compressed formats. Now only if there were multi-threading support in XZ...
Or you can use bsdtar -xf which is equivalent to tar -xf. just like Nutria says there is no big difference between two of them.
Compresing with xz result slower than compresing gz, also uncompresing have the same facts. xz uses lzma2 lossless algoritham and is not so widely used like gz. Almost every source you find on net will be compressed with gz or bz2 regardless that there are numbers of disto which usees xz as for compressing pkg's: Some of them are archlinux, fedora also use lzma2 on rpm.
What is the difference between a tar.gz and a tar.xz file ?
Thank you all for your help. It is appreciated, especially
tar xvf package.tar.xz
And I think there is some validity to the statement
that having someone sitting in front of a computer is
expensive. Especially if you are the one paying.
As for DOS, when I run my ancient 486 with Novell DOS
I'm impressed with how fast it is. We pay a high price
for fancy graphics in speed and resouces. Most of the
time its necessary, but sometimes not.
Anyway, this thread is solved ! Thanks to everyone !
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.