Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

As far as I can tell, XZ is a container that uses the LZMA2 algorithm (i.e. extended LZMA); but e.g.

$ xz foo/

complains about foo/ being a directory. So presumably the correct way to preserve directories with XZ is with tar; then what is the difference between tar --lzma and tar --xz?

(Note that I do explicitly want ownership and permissions preserved, which is why I'm not just using 7z.)

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

This options control which external binary tar calls for compressing its data stream: lzma and xz respectively. While both of them uses the same compression algorithm by default, xz is considered more up-to-date and feature rich, with lzma being somewhat legacy tool. Modern version of xz-utils provides both commands, with lzma being an 'alias' for xz --format=lzma (man xz).

share|improve this answer
    
So with modern xz-utils, there's effectively no difference? –  Andrew Apr 12 '13 at 3:59
    
I believe so, at least when using with tar. xz archives can be concatenated, while lzma cannot (limitations of container format) — that's the only notable difference for me, applying xz was used with lzma compression. –  artyom Apr 12 '13 at 4:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.