2015-09-02 11:30:08 +00:00
|
|
|
\."
|
|
|
|
\." lz4.1: This is a manual page for 'lz4' program. This file is part of the
|
|
|
|
\." lz4 <http://www.lz4.org/> project.
|
|
|
|
\." Author: Yann Collet
|
|
|
|
\."
|
|
|
|
.
|
|
|
|
\." No hyphenation
|
2013-12-30 17:16:52 +00:00
|
|
|
.hy 0
|
|
|
|
.nr HY 0
|
2015-09-02 11:30:08 +00:00
|
|
|
.
|
2015-03-22 12:42:00 +00:00
|
|
|
.TH lz4 "1" "2015-03-21" "lz4" "User Commands"
|
2013-12-30 17:16:52 +00:00
|
|
|
.SH NAME
|
2015-03-22 12:42:00 +00:00
|
|
|
\fBlz4, unlz4, lz4cat\fR \- Compress or decompress .lz4 files
|
2013-12-30 17:16:52 +00:00
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.TP 5
|
|
|
|
\fBlz4\fR [\fBOPTIONS\fR] [-|INPUT-FILE] <OUTPUT-FILE>
|
2015-03-22 12:42:00 +00:00
|
|
|
.PP
|
|
|
|
.B unlz4
|
|
|
|
is equivalent to
|
2016-02-12 22:34:07 +00:00
|
|
|
.BR "lz4 \-d"
|
2015-03-22 12:42:00 +00:00
|
|
|
.br
|
|
|
|
.B lz4cat
|
|
|
|
is equivalent to
|
2016-11-10 00:57:33 +00:00
|
|
|
.BR "lz4 \-dcfm"
|
2015-03-22 12:42:00 +00:00
|
|
|
.br
|
|
|
|
.PP
|
|
|
|
When writing scripts that need to decompress files,
|
|
|
|
it is recommended to always use the name
|
|
|
|
.B lz4
|
|
|
|
with appropriate arguments
|
|
|
|
.RB ( "lz4 \-d"
|
|
|
|
or
|
|
|
|
.BR "lz4 \-dc" )
|
|
|
|
instead of the names
|
|
|
|
.B unlz4
|
|
|
|
and
|
|
|
|
.BR lz4cat .
|
|
|
|
|
2013-12-30 17:16:52 +00:00
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.PP
|
2015-03-22 12:42:00 +00:00
|
|
|
\fBlz4\fR is an extremely fast lossless compression algorithm,
|
|
|
|
based on \fBbyte-aligned LZ77\fR family of compression scheme.
|
2016-02-12 22:34:07 +00:00
|
|
|
\fBlz4\fR offers compression speeds of 400 MB/s per core, linearly scalable with multi-core CPUs.
|
2015-03-22 12:42:00 +00:00
|
|
|
It features an extremely fast decoder, with speed in multiple GB/s per core,
|
2016-02-12 22:34:07 +00:00
|
|
|
typically reaching RAM speed limit on multi-core systems.
|
2015-03-22 12:42:00 +00:00
|
|
|
The native file format is the
|
|
|
|
.B .lz4
|
|
|
|
format.
|
|
|
|
|
2016-02-12 22:34:07 +00:00
|
|
|
.B lz4
|
2016-11-05 01:29:07 +00:00
|
|
|
supports a command line syntax similar \fIbut not identical\fR to
|
2016-02-12 22:34:07 +00:00
|
|
|
.BR gzip (1).
|
|
|
|
Differences are :
|
2016-11-05 01:29:07 +00:00
|
|
|
\fBlz4\fR preserves original files
|
|
|
|
\fBlz4\fR compresses a single file by default (use \fB-m\fR for multiple files)
|
|
|
|
\fBlz4 file1 file2\fR means : compress file1 \fIinto\fR file2
|
|
|
|
When no destination name is provided, compressed file name receives a \fB.lz4\fR suffix
|
|
|
|
When no destination name is provided, if \fBstdout\fR is \fInot\fR the console, it becomes the output (like a silent \fB-c\fR)
|
|
|
|
Therefore \fBlz4 file > /dev/null\fR will not create \fBfile.lz4\fR
|
|
|
|
\fBlz4 file\fR shows real-time statistics during compression (use \fB-q\fR to silent them)
|
2015-12-20 14:48:15 +00:00
|
|
|
|
|
|
|
Default behaviors can be modified by opt-in commands, described below.
|
|
|
|
\fBlz4 --quiet --multiple\fR more closely mimics \fBgzip\fR behavior.
|
|
|
|
|
2015-03-22 12:42:00 +00:00
|
|
|
.SS "Concatenation of .lz4 files"
|
|
|
|
It is possible to concatenate
|
|
|
|
.B .lz4
|
|
|
|
files as is.
|
|
|
|
.B lz4
|
|
|
|
will decompress such files as if they were a single
|
|
|
|
.B .lz4
|
2015-03-23 18:59:41 +00:00
|
|
|
file. For example:
|
|
|
|
lz4 file1 > foo.lz4
|
|
|
|
lz4 file2 >> foo.lz4
|
|
|
|
then
|
|
|
|
lz4cat foo.lz4
|
|
|
|
is equivalent to :
|
|
|
|
cat file1 file2
|
|
|
|
|
2015-03-22 12:42:00 +00:00
|
|
|
.PP
|
2013-12-30 17:16:52 +00:00
|
|
|
|
|
|
|
.SH OPTIONS
|
2015-03-22 12:42:00 +00:00
|
|
|
.
|
2015-03-23 18:59:41 +00:00
|
|
|
.SS "Short commands concatenation"
|
2015-03-22 12:42:00 +00:00
|
|
|
In some cases, some options can be expressed using short command
|
|
|
|
.B "-x"
|
|
|
|
or long command
|
|
|
|
.B "--long-word" .
|
|
|
|
Short commands can be concatenated together. For example,
|
|
|
|
.B "-d -c"
|
|
|
|
is equivalent to
|
|
|
|
.B "-dc" .
|
|
|
|
Long commands cannot be concatenated.
|
|
|
|
They must be clearly separated by a space.
|
2015-03-23 18:59:41 +00:00
|
|
|
.SS "Multiple commands"
|
|
|
|
When multiple contradictory commands are issued on a same command line,
|
|
|
|
only the latest one will be applied.
|
2015-03-22 12:42:00 +00:00
|
|
|
.
|
|
|
|
.SS "Operation mode"
|
|
|
|
.TP
|
|
|
|
.BR \-z ", " \-\-compress
|
|
|
|
Compress.
|
2016-02-12 22:34:07 +00:00
|
|
|
This is the default operation mode
|
2015-03-22 12:42:00 +00:00
|
|
|
when no operation mode option is specified ,
|
2016-02-12 22:34:07 +00:00
|
|
|
no other operation mode is implied from the command name
|
2015-03-22 12:42:00 +00:00
|
|
|
(for example,
|
|
|
|
.B unlz4
|
|
|
|
implies
|
|
|
|
.B \-\-decompress ),
|
|
|
|
nor from the input file name
|
|
|
|
(for example, a file extension
|
|
|
|
.B .lz4
|
|
|
|
implies
|
|
|
|
.B \-\-decompress
|
|
|
|
by default).
|
|
|
|
.B -z
|
|
|
|
can also be used to force compression of an already compressed
|
|
|
|
.B .lz4
|
|
|
|
file.
|
|
|
|
.TP
|
|
|
|
.BR \-d ", " \-\-decompress ", " \-\-uncompress
|
|
|
|
Decompress.
|
|
|
|
.B --decompress
|
|
|
|
is also the default operation when the input filename has an
|
|
|
|
.B .lz4
|
2016-11-04 19:46:39 +00:00
|
|
|
extension.
|
2015-03-22 12:42:00 +00:00
|
|
|
.TP
|
|
|
|
.BR \-t ", " \-\-test
|
|
|
|
Test the integrity of compressed
|
|
|
|
.B .lz4
|
|
|
|
files.
|
|
|
|
The decompressed data is discarded.
|
2015-03-23 20:22:13 +00:00
|
|
|
No files are created nor removed.
|
2016-11-05 01:29:07 +00:00
|
|
|
|
|
|
|
.TP
|
|
|
|
.BR \-b#
|
|
|
|
Benchmark mode, using # compression level.
|
|
|
|
|
2015-03-22 12:42:00 +00:00
|
|
|
.
|
|
|
|
.SS "Operation modifiers"
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2016-11-10 20:22:37 +00:00
|
|
|
.B \-#
|
|
|
|
compression level, with # being any value from 1 to 16.
|
|
|
|
Higher values trade compression speed for compression ratio.
|
|
|
|
Values above 16 are considered the same as 16.
|
|
|
|
Recommended values are 1 for fast compression (default), and 9 for high compression.
|
|
|
|
Speed/compression trade-off will vary depending on data to compress.
|
|
|
|
Decompression speed remains fast at all settings.
|
2015-03-22 12:42:00 +00:00
|
|
|
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-03-23 20:22:13 +00:00
|
|
|
.BR \-f ", " --[no-]force
|
2015-03-22 12:42:00 +00:00
|
|
|
This option has several effects:
|
|
|
|
.RS
|
|
|
|
.IP \(bu 3
|
|
|
|
If the target file already exists,
|
|
|
|
overwrite it without prompting.
|
|
|
|
.IP \(bu 3
|
|
|
|
When used with
|
|
|
|
.B \-\-decompress
|
|
|
|
and
|
|
|
|
.B lz4
|
|
|
|
cannot recognize the type of the source file,
|
|
|
|
copy the source file as is to standard output.
|
|
|
|
This allows
|
|
|
|
.B lz4cat
|
|
|
|
.B \-\-force
|
|
|
|
to be used like
|
|
|
|
.BR cat (1)
|
|
|
|
for files that have not been compressed with
|
|
|
|
.BR lz4 .
|
|
|
|
.RE
|
|
|
|
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-03-22 12:42:00 +00:00
|
|
|
.BR \-c ", " \--stdout ", " \--to-stdout
|
|
|
|
force write to standard output, even if it is the console
|
|
|
|
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-04-13 19:43:54 +00:00
|
|
|
.BR \-m ", " \--multiple
|
2015-03-22 12:42:00 +00:00
|
|
|
Multiple file names.
|
2015-12-20 14:48:15 +00:00
|
|
|
By default, the second filename is used as the destination filename for the compressed file.
|
2015-03-22 12:42:00 +00:00
|
|
|
With
|
|
|
|
.B -m
|
2016-11-10 20:22:37 +00:00
|
|
|
, it is possible to specify any number of input filenames. Each of them will be compressed
|
2015-12-20 14:48:15 +00:00
|
|
|
independently, and the resulting name of each compressed file will be
|
2015-03-22 12:42:00 +00:00
|
|
|
.B filename.lz4
|
|
|
|
.
|
|
|
|
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-03-22 12:42:00 +00:00
|
|
|
.B \-B#
|
|
|
|
block size [4-7](default : 7)
|
|
|
|
B4= 64KB ; B5= 256KB ; B6= 1MB ; B7= 4MB
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-03-22 12:42:00 +00:00
|
|
|
.B \-BD
|
2015-12-20 14:48:15 +00:00
|
|
|
block dependency (improves compression ratio on small blocks)
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-03-23 20:22:13 +00:00
|
|
|
.B \--[no-]frame-crc
|
2015-04-15 09:34:08 +00:00
|
|
|
select frame checksum (default:enabled)
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-03-23 20:22:13 +00:00
|
|
|
.B \--[no-]content-size
|
2015-04-15 09:34:08 +00:00
|
|
|
header includes original size (default:not present)
|
2015-03-23 20:22:13 +00:00
|
|
|
Note : this option can only be activated when the original size can be determined,
|
2015-04-15 09:34:08 +00:00
|
|
|
hence for a file. It won't work with unknown source size, such as stdin or pipe.
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2016-02-12 22:34:07 +00:00
|
|
|
.B \--[no-]sparse
|
2015-06-22 04:00:44 +00:00
|
|
|
sparse mode support (default:enabled on file, disabled on stdout)
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
|
|
|
.B \-l
|
|
|
|
use Legacy format (useful for Linux Kernel compression)
|
2015-03-22 12:42:00 +00:00
|
|
|
.
|
|
|
|
.SS "Other options"
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-03-22 12:42:00 +00:00
|
|
|
.BR \-v ", " --verbose
|
|
|
|
verbose mode
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-03-22 12:42:00 +00:00
|
|
|
.BR \-q ", " --quiet
|
2015-12-20 14:48:15 +00:00
|
|
|
suppress warnings and real-time statistics; specify twice to suppress errors too
|
2015-03-22 12:42:00 +00:00
|
|
|
.TP
|
2016-11-13 01:21:29 +00:00
|
|
|
.B \-h/\-H ", " --help
|
2015-03-22 12:42:00 +00:00
|
|
|
display help/long help and exit
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-03-22 12:42:00 +00:00
|
|
|
.BR \-V ", " \--version
|
|
|
|
display Version number and exit
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2015-03-22 12:42:00 +00:00
|
|
|
.BR \-k ", " \--keep
|
|
|
|
Don't delete source file.
|
|
|
|
This is default behavior anyway, so this option is just for compatibility with gzip/xz.
|
2016-11-05 01:29:07 +00:00
|
|
|
|
|
|
|
.
|
|
|
|
.SS "Benchmark mode"
|
|
|
|
.TP
|
|
|
|
.B \-b#
|
|
|
|
benchmark file(s), using # compression level
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
2016-11-05 01:29:07 +00:00
|
|
|
.B \-e#
|
|
|
|
benchmark multiple compression levels, from b# to e# (included)
|
2013-12-30 17:16:52 +00:00
|
|
|
.TP
|
|
|
|
.B \-i#
|
2016-11-05 01:29:07 +00:00
|
|
|
minimum evaluation in seconds [1-9] (default : 3)
|
|
|
|
.TP
|
|
|
|
.B \-r
|
|
|
|
operate recursively on directories
|
|
|
|
|
2013-12-30 17:16:52 +00:00
|
|
|
|
|
|
|
.SH BUGS
|
2015-09-01 14:59:24 +00:00
|
|
|
Report bugs at: https://github.com/Cyan4973/lz4/issues
|
2013-12-30 17:16:52 +00:00
|
|
|
|
|
|
|
.SH AUTHOR
|
2014-05-19 23:40:29 +00:00
|
|
|
Yann Collet
|