I want to run tar --lzip -cvf file1.txt file2.txt. But lzip's help page states that by default it does not run at its fullest compression power (the option for which is -9, while the default is -6). I could run tar first to concatenate the files and then run lzip -9 on the resulting tar, but is it possible to do so in one command?

1 Answer 1


You can use tar's -I option specifying the "compression program":

tar -cvf archive.lz -I 'lzip -9' file1.txt file2.txt

Or you can pipe tar's output through lzip:

tar -cvf - file1.txt file2.txt | lzip -9 > archive.lz

Both options are described in the GNU tar manual (search for the first -I).

  • Warning: The -I option in tar is used to give a list of files to process. If your local tar implementation does something else, this is a non-standard behavior.
    – schily
    Aug 8, 2019 at 12:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .