How to XZ a directory with TAR using maximum compression?
So I need to compress a directory with max compression.
How can I do it with
xz? I mean I will need
tartoo because I can't compress a directory with only
xz. Is there a oneliner to produce e.g.
xzhonors the standard set of commandline flags - including compression level flags, you could try:
tar -cf - foo/ | xz -9 -c - > foo.tar.xz
`-9e` will not always give you the best result - see point 8 here https://www.rootusers.com/13-simple-xz-examples/
@KolonUK reading that article, it shows that `-e` (extreme mode) always improves compression ratio; the comparison is between `-0e` and `-6`; while `-e` always improves compression ratio within the same compression level, a higher compression level may be more effective than "extreme mode". There is no evidence that `-9e` can yield a worse compression ratio than `-9`.