kusano 7d535a
\"
kusano 7d535a
\" lz4.1: This is a manual page for 'lz4' program. This file is part of the
kusano 7d535a
\" lz4 <https: code.google.com="" lz4="" p=""> project.</https:>
kusano 7d535a
\" Author: Yann Collet
kusano 7d535a
\"
kusano 7d535a
kusano 7d535a
\" No hyphenation
kusano 7d535a
.hy 0
kusano 7d535a
.nr HY 0
kusano 7d535a
kusano 7d535a
.TH lz4 "1" "2015-03-21" "lz4" "User Commands"
kusano 7d535a
.SH NAME
kusano 7d535a
\fBlz4, unlz4, lz4cat\fR \- Compress or decompress .lz4 files
kusano 7d535a
kusano 7d535a
.SH SYNOPSIS
kusano 7d535a
.TP 5
kusano 7d535a
\fBlz4\fR [\fBOPTIONS\fR] [-|INPUT-FILE] <output-file></output-file>
kusano 7d535a
.PP
kusano 7d535a
.B unlz4
kusano 7d535a
is equivalent to
kusano 7d535a
.BR "lz4 \-d" 
kusano 7d535a
.br
kusano 7d535a
.B lz4cat
kusano 7d535a
is equivalent to
kusano 7d535a
.BR "lz4 \-dc" 
kusano 7d535a
.br
kusano 7d535a
.PP
kusano 7d535a
When writing scripts that need to decompress files,
kusano 7d535a
it is recommended to always use the name
kusano 7d535a
.B lz4
kusano 7d535a
with appropriate arguments
kusano 7d535a
.RB ( "lz4 \-d"
kusano 7d535a
or
kusano 7d535a
.BR "lz4 \-dc" )
kusano 7d535a
instead of the names
kusano 7d535a
.B unlz4
kusano 7d535a
and
kusano 7d535a
.BR lz4cat .
kusano 7d535a
kusano 7d535a
kusano 7d535a
.SH DESCRIPTION
kusano 7d535a
.PP
kusano 7d535a
\fBlz4\fR is an extremely fast lossless compression algorithm,
kusano 7d535a
based on \fBbyte-aligned LZ77\fR family of compression scheme.
kusano 7d535a
\fBlz4\fR offers compression speeds of 400 MB/s per core, linearly scalable with multi-core CPUs. 
kusano 7d535a
It features an extremely fast decoder, with speed in multiple GB/s per core,
kusano 7d535a
typically reaching RAM speed limit on multi-core systems. 
kusano 7d535a
.B lz4
kusano 7d535a
supports a command line syntax similar to
kusano 7d535a
.BR gzip (1).
kusano 7d535a
The native file format is the
kusano 7d535a
.B .lz4
kusano 7d535a
format.
kusano 7d535a
kusano 7d535a
.SS "Concatenation of .lz4 files"
kusano 7d535a
It is possible to concatenate
kusano 7d535a
.B .lz4
kusano 7d535a
files as is.
kusano 7d535a
.B lz4
kusano 7d535a
will decompress such files as if they were a single
kusano 7d535a
.B .lz4
kusano 7d535a
file. For example:
kusano 7d535a
  lz4 file1  > foo.lz4
kusano 7d535a
  lz4 file2 >> foo.lz4
kusano 7d535a
 then
kusano 7d535a
  lz4cat foo.lz4
kusano 7d535a
 is equivalent to :
kusano 7d535a
  cat file1 file2
kusano 7d535a
kusano 7d535a
.PP
kusano 7d535a
kusano 7d535a
.SH OPTIONS
kusano 7d535a
.
kusano 7d535a
.SS "Short commands concatenation"
kusano 7d535a
In some cases, some options can be expressed using short command
kusano 7d535a
.B "-x"
kusano 7d535a
or long command
kusano 7d535a
.B "--long-word" .
kusano 7d535a
Short commands can be concatenated together. For example,
kusano 7d535a
.B "-d -c"
kusano 7d535a
is equivalent to
kusano 7d535a
.B "-dc" .
kusano 7d535a
Long commands cannot be concatenated.
kusano 7d535a
They must be clearly separated by a space.
kusano 7d535a
.SS "Multiple commands"
kusano 7d535a
When multiple contradictory commands are issued on a same command line,
kusano 7d535a
only the latest one will be applied.
kusano 7d535a
.
kusano 7d535a
.SS "Operation mode"
kusano 7d535a
.TP
kusano 7d535a
.BR \-z ", " \-\-compress
kusano 7d535a
Compress.
kusano 7d535a
This is the default operation mode 
kusano 7d535a
when no operation mode option is specified ,
kusano 7d535a
no other operation mode is implied from the command name 
kusano 7d535a
(for example,
kusano 7d535a
.B unlz4
kusano 7d535a
implies
kusano 7d535a
.B \-\-decompress ),
kusano 7d535a
nor from the input file name
kusano 7d535a
(for example, a file extension
kusano 7d535a
.B .lz4
kusano 7d535a
implies
kusano 7d535a
.B \-\-decompress
kusano 7d535a
by default).
kusano 7d535a
.B -z
kusano 7d535a
can also be used to force compression of an already compressed
kusano 7d535a
.B .lz4
kusano 7d535a
file.
kusano 7d535a
.TP
kusano 7d535a
.BR \-d ", " \-\-decompress ", " \-\-uncompress
kusano 7d535a
Decompress.
kusano 7d535a
.B --decompress
kusano 7d535a
is also the default operation when the input filename has an
kusano 7d535a
.B .lz4
kusano 7d535a
extensionq
kusano 7d535a
.TP
kusano 7d535a
.BR \-t ", " \-\-test
kusano 7d535a
Test the integrity of compressed
kusano 7d535a
.B .lz4
kusano 7d535a
files.
kusano 7d535a
The decompressed data is discarded.
kusano 7d535a
No files are created nor removed.
kusano 7d535a
.
kusano 7d535a
.SS "Operation modifiers"
kusano 7d535a
.TP
kusano 7d535a
.B \-1
kusano 7d535a
 fast compression (default)
kusano 7d535a
.TP
kusano 7d535a
.B \-9
kusano 7d535a
 high compression
kusano 7d535a
kusano 7d535a
.TP
kusano 7d535a
.BR \-f ", " --[no-]force
kusano 7d535a
 This option has several effects:
kusano 7d535a
.RS
kusano 7d535a
.IP \(bu 3
kusano 7d535a
If the target file already exists,
kusano 7d535a
overwrite it without prompting.
kusano 7d535a
.IP \(bu 3
kusano 7d535a
When used with
kusano 7d535a
.B \-\-decompress
kusano 7d535a
and
kusano 7d535a
.B lz4
kusano 7d535a
cannot recognize the type of the source file,
kusano 7d535a
copy the source file as is to standard output.
kusano 7d535a
This allows
kusano 7d535a
.B lz4cat
kusano 7d535a
.B \-\-force
kusano 7d535a
to be used like
kusano 7d535a
.BR cat (1)
kusano 7d535a
for files that have not been compressed with
kusano 7d535a
.BR lz4 .
kusano 7d535a
.RE
kusano 7d535a
kusano 7d535a
.TP
kusano 7d535a
.BR \-c ", " \--stdout ", " \--to-stdout
kusano 7d535a
 force write to standard output, even if it is the console
kusano 7d535a
kusano 7d535a
.TP
kusano 7d535a
.BR \-m ", " \--multiple
kusano 7d535a
 Multiple file names.
kusano 7d535a
 By default, the second filename is used as the output filename for the compressed file.
kusano 7d535a
 With
kusano 7d535a
.B -m
kusano 7d535a
, you can specify any number of input filenames. Each of them will be compressed
kusano 7d535a
independently, and the resulting name of the compressed file will be
kusano 7d535a
.B filename.lz4
kusano 7d535a
.
kusano 7d535a
kusano 7d535a
.TP
kusano 7d535a
.B \-B#
kusano 7d535a
 block size [4-7](default : 7)
kusano 7d535a
 B4= 64KB ; B5= 256KB ; B6= 1MB ; B7= 4MB
kusano 7d535a
.TP
kusano 7d535a
.B \-BD
kusano 7d535a
 block dependency (improve compression ratio)
kusano 7d535a
.TP
kusano 7d535a
.B \--[no-]frame-crc
kusano 7d535a
 select frame checksum (default:enabled)
kusano 7d535a
.TP
kusano 7d535a
.B \--[no-]content-size
kusano 7d535a
 header includes original size (default:not present)
kusano 7d535a
 Note : this option can only be activated when the original size can be determined,
kusano 7d535a
hence for a file. It won't work with unknown source size, such as stdin or pipe.
kusano 7d535a
.TP
kusano 7d535a
.B \--[no-]sparse 
kusano 7d535a
 sparse mode support (default:enabled on file, disabled on stdout)
kusano 7d535a
.TP
kusano 7d535a
.B \-l
kusano 7d535a
 use Legacy format (useful for Linux Kernel compression)
kusano 7d535a
.
kusano 7d535a
.SS "Other options"
kusano 7d535a
.TP
kusano 7d535a
.BR \-v ", " --verbose
kusano 7d535a
 verbose mode
kusano 7d535a
.TP
kusano 7d535a
.BR \-q ", " --quiet
kusano 7d535a
 suppress warnings; specify twice to suppress errors too
kusano 7d535a
.TP
kusano 7d535a
.B \-h/\-H
kusano 7d535a
 display help/long help and exit
kusano 7d535a
.TP
kusano 7d535a
.BR \-V ", " \--version
kusano 7d535a
 display Version number and exit
kusano 7d535a
.TP
kusano 7d535a
.BR \-k ", " \--keep
kusano 7d535a
 Don't delete source file.
kusano 7d535a
This is default behavior anyway, so this option is just for compatibility with gzip/xz.
kusano 7d535a
.TP
kusano 7d535a
.B \-b
kusano 7d535a
 benchmark file(s)
kusano 7d535a
.TP
kusano 7d535a
.B \-i#
kusano 7d535a
 iteration loops [1-9](default : 3), benchmark mode only
kusano 7d535a
kusano 7d535a
.SH BUGS
kusano 7d535a
Report bugs at: https://github.com/Cyan4973/lz4
kusano 7d535a
kusano 7d535a
.SH AUTHOR
kusano 7d535a
Yann Collet