7

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.)

1 Answer 1

8

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).

2
  • So with modern xz-utils, there's effectively no difference? Commented Apr 12, 2013 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. Commented Apr 12, 2013 at 4:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.