lzip: Invoking lzip
3 Invoking lzip
***************
The format for running lzip is:
lzip [OPTIONS] [FILES]
If no file names are specified, lzip compresses (or decompresses) from
standard input to standard output. A hyphen '-' used as a FILE argument
means standard input. It can be mixed with other FILES and is read just
once, the first time it appears in the command line.
lzip supports the following options: ⇒Argument syntax
(arg_parser)Argument syntax.
'-h'
'--help'
Print an informative help message describing the options and exit.
'-V'
'--version'
Print the version number of lzip on the standard output and exit. This
version number should be included in all bug reports.
'-a'
'--trailing-error'
Exit with error status 2 if any remaining input is detected after
decompressing the last member. Such remaining input is usually trailing
garbage that can be safely ignored. ⇒concat-example.
'-b BYTES'
'--member-size=BYTES'
When compressing, set the member size limit to BYTES. It is advisable
to keep members smaller than RAM size so that they can be repaired with
lziprecover in case of corruption. A small member size may degrade
compression ratio, so use it only when needed. Valid values range from
100 kB to 2 PiB. Defaults to 2 PiB.
'-c'
'--stdout'
Compress or decompress to standard output; keep input files unchanged.
If compressing several files, each file is compressed independently.
(The output consists of a sequence of independently compressed
members). This option (or '-o') is needed when reading from a named
pipe (fifo) or from a device. Use it also to recover as much of the
decompressed data as possible when decompressing a corrupt file. '-c'
overrides '-o' and '-S'. '-c' has no effect when testing or listing.
'-d'
'--decompress'
Decompress the files specified. If a file does not exist, can't be
opened, or the destination file already exists and '--force' has not
been specified, lzip continues decompressing the rest of the files and
exits with error status 1. If a file fails to decompress, or is a
terminal, lzip exits immediately with error status 2 without
decompressing the rest of the files. A terminal is considered an
uncompressed file, and therefore invalid.
'-f'
'--force'
Force overwrite of output files.
'-F'
'--recompress'
When compressing, force re-compression of files whose name already has
the '.lz' or '.tlz' suffix.
'-k'
'--keep'
Keep (don't delete) input files during compression or decompression.
'-l'
'--list'
Print the uncompressed size, compressed size, and percentage saved of
the files specified. Trailing data are ignored. The values produced
are correct even for multimember files. If more than one file is
given, a final line containing the cumulative sizes is printed. With
'-v', the dictionary size, the number of members in the file, and the
amount of trailing data (if any) are also printed. With '-vv', the
positions and sizes of each member in multimember files are also
printed.
If any file is damaged, does not exist, can't be opened, or is not
regular, the final exit status will be > 0. '-lq' can be used to verify
quickly (without decompressing) the structural integrity of the files
specified. (Use '--test' to verify the data integrity). '-alq'
additionally verifies that none of the files specified contain
trailing data.
'-m BYTES'
'--match-length=BYTES'
When compressing, set the match length limit in bytes. After a match
this long is found, the search is finished. Valid values range from 5
to 273. Larger values usually give better compression ratios but longer
compression times.
'-o FILE'
'--output=FILE'
If '-c' has not been also specified, write the (de)compressed output to
FILE; keep input files unchanged. If compressing several files, each
file is compressed independently. (The output consists of a sequence of
independently compressed members). This option (or '-c') is needed when
reading from a named pipe (fifo) or from a device. '-o -' is
equivalent to '-c'. '-o' has no effect when testing or listing.
In order to keep backward compatibility with lzip versions prior to
1.22, when compressing from standard input and no other file names are
given, the extension '.lz' is appended to FILE unless it already ends
in '.lz' or '.tlz'. This feature will be removed in a future version
of lzip. Meanwhile, redirection may be used instead of '-o' to write
the compressed output to a file without the extension '.lz' in its
name: 'lzip < file > foo'.
When compressing and splitting the output in volumes, FILE is used as
a prefix, and several files named 'FILE00001.lz', 'FILE00002.lz', etc,
are created. In this case, only one input file is allowed.
'-q'
'--quiet'
Quiet operation. Suppress all messages.
'-s BYTES'
'--dictionary-size=BYTES'
When compressing, set the dictionary size limit in bytes. Lzip will use
for each file the largest dictionary size that does not exceed neither
the file size nor this limit. Valid values range from 4 KiB to
512 MiB. Values 12 to 29 are interpreted as powers of two, meaning
2^12 to 2^29 bytes. Dictionary sizes are quantized so that they can be
coded in just one byte (⇒coded-dict-size). If the size specified
does not match one of the valid sizes, it will be rounded upwards by
adding up to (BYTES / 8) to it.
For maximum compression you should use a dictionary size limit as large
as possible, but keep in mind that the decompression memory requirement
is affected at compression time by the choice of dictionary size limit.
'-S BYTES'
'--volume-size=BYTES'
When compressing, and '-c' has not been also specified, split the
compressed output into several volume files with names
'original_name00001.lz', 'original_name00002.lz', etc, and set the
volume size limit to BYTES. Input files are kept unchanged. Each
volume is a complete, maybe multimember, lzip file. A small volume
size may degrade compression ratio, so use it only when needed. Valid
values range from 100 kB to 4 EiB.
'-t'
'--test'
Check integrity of the files specified, but don't decompress them. This
really performs a trial decompression and throws away the result. Use
it together with '-v' to see information about the files. If a file
fails the test, does not exist, can't be opened, or is a terminal, lzip
continues checking the rest of the files. A final diagnostic is shown
at verbosity level 1 or higher if any file fails the test when testing
multiple files.
'-v'
'--verbose'
Verbose mode.
When compressing, show the compression ratio and size for each file
processed.
When decompressing or testing, further -v's (up to 4) increase the
verbosity level, showing status, compression ratio, dictionary size,
trailer contents (CRC, data size, member size), and up to 6 bytes of
trailing data (if any) both in hexadecimal and as a string of printable
ASCII characters.
Two or more '-v' options show the progress of (de)compression.
'-0 .. -9'
Compression level. Set the compression parameters (dictionary size and
match length limit) as shown in the table below. The default
compression level is '-6', equivalent to '-s8MiB -m36'. Note that '-9'
can be much slower than '-0'. These options have no effect when
decompressing, testing, or listing.
The bidimensional parameter space of LZMA can't be mapped to a linear
scale optimal for all files. If your files are large, very repetitive,
etc, you may need to use the options '--dictionary-size' and
'--match-length' directly to achieve optimal performance.
If several compression levels or '-s' or '-m' options are given, the
last setting is used. For example '-9 -s64MiB' is equivalent to
'-s64MiB -m273'
Level Dictionary size (-s) Match length limit (-m)
-0 64 KiB 16 bytes
-1 1 MiB 5 bytes
-2 1.5 MiB 6 bytes
-3 2 MiB 8 bytes
-4 3 MiB 12 bytes
-5 4 MiB 20 bytes
-6 8 MiB 36 bytes
-7 16 MiB 68 bytes
-8 24 MiB 132 bytes
-9 32 MiB 273 bytes
'--fast'
'--best'
Aliases for GNU gzip compatibility.
'--loose-trailing'
When decompressing, testing, or listing, allow trailing data whose
first bytes are so similar to the magic bytes of a lzip header that
they can be confused with a corrupt header. Use this option if a file
triggers a "corrupt header" error and the cause is not indeed a
corrupt header.
Numbers given as arguments to options may be followed by a multiplier
and an optional 'B' for "byte".
Table of SI and binary prefixes (unit multipliers):
Prefix Value | Prefix Value
k kilobyte (10^3 = 1000) | Ki kibibyte (2^10 = 1024)
M megabyte (10^6) | Mi mebibyte (2^20)
G gigabyte (10^9) | Gi gibibyte (2^30)
T terabyte (10^12) | Ti tebibyte (2^40)
P petabyte (10^15) | Pi pebibyte (2^50)
E exabyte (10^18) | Ei exbibyte (2^60)
Z zettabyte (10^21) | Zi zebibyte (2^70)
Y yottabyte (10^24) | Yi yobibyte (2^80)
Exit status: 0 for a normal exit, 1 for environmental problems (file not
found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or invalid
input file, 3 for an internal consistency error (e.g., bug) which caused
lzip to panic.