LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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



Reply
 
Search this Thread
Old 10-01-2012, 06:07 PM   #1
zeelog
Member
 
Registered: Jan 2008
Posts: 110

Rep: Reputation: 1
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 ?
 
Old 10-01-2012, 07:20 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,650
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
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.
 
1 members found this post helpful.
Old 10-01-2012, 09:54 PM   #3
John VV
Guru
 
Registered: Aug 2005
Posts: 13,469

Rep: Reputation: 1800Reputation: 1800Reputation: 1800Reputation: 1800Reputation: 1800Reputation: 1800Reputation: 1800Reputation: 1800Reputation: 1800Reputation: 1800Reputation: 1800
to add

the newer xz format compresses most code a bit better than gzip dose

other than that , not much differance

just a different compression tool
 
1 members found this post helpful.
Old 10-01-2012, 11:09 PM   #4
Nutria
Member
 
Registered: Nov 2007
Location: New Orleans, LA, USA
Distribution: Xubuntu
Posts: 65

Rep: Reputation: 6
Quote:
Originally Posted by John VV View Post
to add

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.
 
2 members found this post helpful.
Old 10-01-2012, 11:28 PM   #5
Toadbrooks
Member
 
Registered: Jul 2008
Distribution: Linux Mint 16
Posts: 75

Rep: Reputation: 7
Quote:
Originally Posted by zeelog View Post
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.
 
1 members found this post helpful.
Old 10-01-2012, 11:43 PM   #6
Nutria
Member
 
Registered: Nov 2007
Location: New Orleans, LA, USA
Distribution: Xubuntu
Posts: 65

Rep: Reputation: 6
Quote:
Originally Posted by Toadbrooks View Post
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.
 
Old 10-02-2012, 01:00 AM   #7
Toadbrooks
Member
 
Registered: Jul 2008
Distribution: Linux Mint 16
Posts: 75

Rep: Reputation: 7
Quote:
Originally Posted by Nutria View Post
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."
 
2 members found this post helpful.
Old 10-02-2012, 03:02 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,266

Rep: Reputation: 2661Reputation: 2661Reputation: 2661Reputation: 2661Reputation: 2661Reputation: 2661Reputation: 2661Reputation: 2661Reputation: 2661Reputation: 2661Reputation: 2661
XZ :

Unpack with : tar xvf package.tar.xz

( Unless it's an OS with an old version of tar, not recognizing xz.)
 
1 members found this post helpful.
Old 10-02-2012, 08:04 AM   #9
takeshimitsuiami
LQ Newbie
 
Registered: Sep 2012
Posts: 2

Rep: Reputation: Disabled
check this out
http://tukaani.org/lzma/benchmarks.html
 
Old 10-02-2012, 01:19 PM   #10
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,216

Rep: Reputation: 820Reputation: 820Reputation: 820Reputation: 820Reputation: 820Reputation: 820Reputation: 820
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.
 
Old 10-02-2012, 01:34 PM   #11
replica9000
Member
 
Registered: Jul 2006
Location: Quahog, Rhode Island
Distribution: Debian 'Sid', FreeBSD, Android
Posts: 698
Blog Entries: 2

Rep: Reputation: 125Reputation: 125
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...
 
Old 10-02-2012, 01:47 PM   #12
drele
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Rep: Reputation: 0
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.
 
Old 10-12-2012, 10:25 AM   #13
zeelog
Member
 
Registered: Jan 2008
Posts: 110

Original Poster
Rep: Reputation: 1
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 !
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between the commands tar -xvf and tar - xzf kenholtmeyer Linux - Newbie 4 08-03-2011 04:29 PM
"Invalid tar magic" error msg. when I try to tar ldmud *.tar file in DSL pixxi451 Linux - Newbie 4 07-04-2010 09:32 AM
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 10 02-23-2008 06:40 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 03:53 AM


All times are GMT -5. The time now is 02:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration