3

How can I set the compression level for this command?

tar --lzma -cf files/compressed/lzma/archive.lzma -C files/original/ . 

With --bzip I just use:

BZIP2=-9 tar --bzip2 -cf files/compressed/bzip2//archive.tar.bz2 -C files/original/ . 

but with the --lzma option LZMA=-9 doesn't work.

Is this enviroment variable name incorrect? Where can I get the correct variable name?

4
  • Why duplicate? I did not ask how to set compress setting the XZ but lzma... I do not want write command by pipelines but only tar... Commented Jul 30, 2015 at 14:07
  • Retracted it, yours that that have the same answer, so I firstly think it duplicated. Commented Jul 30, 2015 at 14:10
  • @cuonglm You was right is a duplicate - sorry. But i don't understand in tar --help is parameter --xz and --lzma with description filter the archive through xz they are not different comprimation methods? Commented Jul 30, 2015 at 14:24
  • @LajdákMarek xz can compress and decompress lzma files in most cases. See man xz for details... Commented Jul 30, 2015 at 14:28

1 Answer 1

4

If your version of tar uses xz for --lzma (which is likely, even Debian 6 used that), you can use the XZ_OPT variable:

XZ_OPT=-9 tar --lzma ... 
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.