2015-01-24 00:58:16 +00:00
|
|
|
\"
|
|
|
|
\" zstd.1: This is a manual page for 'zstd' program. This file is part of the
|
2015-08-26 10:04:58 +00:00
|
|
|
\" zstd <http://www.zstd.net/> project.
|
|
|
|
\" Author: Yann Collet
|
2015-01-24 00:58:16 +00:00
|
|
|
\"
|
|
|
|
|
|
|
|
\" No hyphenation
|
|
|
|
.hy 0
|
|
|
|
.nr HY 0
|
|
|
|
|
2015-08-26 10:04:58 +00:00
|
|
|
.TH zstd "1" "2015-08-22" "zstd" "User Commands"
|
2015-01-24 00:58:16 +00:00
|
|
|
.SH NAME
|
2015-08-26 10:04:58 +00:00
|
|
|
\fBzstd, unzstd, zstdcat\fR - Compress or decompress .zst files
|
2015-01-24 00:58:16 +00:00
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.TP 5
|
2016-02-16 13:42:08 +00:00
|
|
|
\fBzstd\fR [\fBOPTIONS\fR] [-|INPUT-FILE] [-o <OUTPUT-FILE>]
|
2015-08-26 10:04:58 +00:00
|
|
|
.PP
|
|
|
|
.B unzstd
|
|
|
|
is equivalent to
|
2016-05-30 19:18:52 +00:00
|
|
|
.BR "zstd \-d"
|
2015-08-26 10:04:58 +00:00
|
|
|
.br
|
|
|
|
.B zstdcat
|
|
|
|
is equivalent to
|
2016-05-30 19:18:52 +00:00
|
|
|
.BR "zstd \-dc"
|
2015-08-26 10:04:58 +00:00
|
|
|
.br
|
2015-01-24 00:58:16 +00:00
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.PP
|
2016-11-01 01:10:32 +00:00
|
|
|
\fBzstd\fR is a fast lossless compression algorithm
|
|
|
|
and data compression tool,
|
|
|
|
with command line syntax similar to \fB gzip (1) \fR and \fB xz (1) \fR .
|
2016-02-16 13:42:08 +00:00
|
|
|
It is based on the \fBLZ77\fR family, with further FSE & huff0 entropy stages.
|
2016-11-01 01:10:32 +00:00
|
|
|
\fBzstd\fR offers highly configurable compression speed,
|
|
|
|
with fast modes at > 200 MB/s per core,
|
|
|
|
and strong modes nearing lzma compression ratios.
|
|
|
|
It also features a very fast decoder, with speeds > 500 MB/s per core.
|
2015-12-17 19:30:14 +00:00
|
|
|
|
2016-11-01 01:10:32 +00:00
|
|
|
\fBzstd\fR command line syntax is generally similar to gzip,
|
|
|
|
but features the following differences :
|
|
|
|
- Source files are preserved by default.
|
|
|
|
It's possible to remove them automatically by using \fB--rm\fR command.
|
2016-10-28 20:58:31 +00:00
|
|
|
- When compressing a single file, \fBzstd\fR displays progress notifications and result summary by default.
|
2016-11-01 01:10:32 +00:00
|
|
|
Use \fB-q\fR to turn them off
|
|
|
|
|
|
|
|
.PP
|
|
|
|
.B zstd
|
|
|
|
compresses or decompresses each
|
|
|
|
.I file
|
|
|
|
according to the selected operation mode.
|
|
|
|
If no
|
|
|
|
.I files
|
|
|
|
are given or
|
|
|
|
.I file
|
|
|
|
is
|
|
|
|
.BR \- ,
|
|
|
|
.B zstd
|
|
|
|
reads from standard input and writes the processed data
|
|
|
|
to standard output.
|
|
|
|
.B zstd
|
|
|
|
will refuse (display an error and skip the
|
|
|
|
.IR file )
|
|
|
|
to write compressed data to standard output if it is a terminal.
|
|
|
|
Similarly,
|
|
|
|
.B zstd
|
|
|
|
will refuse to read compressed data
|
|
|
|
from standard input if it is a terminal.
|
|
|
|
|
|
|
|
.PP
|
|
|
|
Unless
|
|
|
|
.B \-\-stdout
|
|
|
|
is specified,
|
|
|
|
.I files
|
|
|
|
are written to a new file whose name is derived from the source
|
|
|
|
.I file
|
|
|
|
name:
|
|
|
|
.IP \(bu 3
|
|
|
|
When compressing, the suffix
|
|
|
|
.B .zst
|
|
|
|
is appended to the source filename to get the target filename.
|
|
|
|
.IP \(bu 3
|
|
|
|
When decompressing, the
|
|
|
|
.B .zst
|
|
|
|
suffix is removed from the filename to get the target filename.
|
|
|
|
|
|
|
|
.SS "Concatenation with .zst files"
|
|
|
|
It is possible to concatenate
|
|
|
|
.B .zst
|
|
|
|
files as is.
|
|
|
|
.B zstd
|
|
|
|
will decompress such files as if they were a single
|
|
|
|
.B .zst
|
|
|
|
file.
|
2015-12-17 19:30:14 +00:00
|
|
|
|
|
|
|
|
2015-01-24 00:58:16 +00:00
|
|
|
|
|
|
|
.SH OPTIONS
|
2016-10-28 20:58:31 +00:00
|
|
|
|
|
|
|
.
|
|
|
|
.SS "Integer suffixes and special values"
|
|
|
|
In most places where an integer argument is expected,
|
|
|
|
an optional suffix is supported to easily indicate large integers.
|
|
|
|
There must be no space between the integer and the suffix.
|
|
|
|
.TP
|
|
|
|
.B KiB
|
|
|
|
Multiply the integer by 1,024 (2^10).
|
|
|
|
.BR Ki ,
|
|
|
|
.BR K ,
|
|
|
|
and
|
|
|
|
.B KB
|
|
|
|
are accepted as synonyms for
|
|
|
|
.BR KiB .
|
|
|
|
.TP
|
|
|
|
.B MiB
|
|
|
|
Multiply the integer by 1,048,576 (2^20).
|
|
|
|
.BR Mi ,
|
|
|
|
.BR M ,
|
|
|
|
and
|
|
|
|
.B MB
|
|
|
|
are accepted as synonyms for
|
|
|
|
.BR MiB .
|
|
|
|
|
|
|
|
.
|
|
|
|
.SS "Operation mode"
|
|
|
|
If multiple operation mode options are given,
|
|
|
|
the last one takes effect.
|
|
|
|
.TP
|
|
|
|
.BR \-z ", " \-\-compress
|
|
|
|
Compress.
|
|
|
|
This is the default operation mode when no operation mode option
|
|
|
|
is specified and no other operation mode is implied from
|
|
|
|
the command name (for example,
|
|
|
|
.B unzstd
|
|
|
|
implies
|
|
|
|
.BR \-\-decompress ).
|
|
|
|
.TP
|
|
|
|
.BR \-d ", " \-\-decompress ", " \-\-uncompress
|
|
|
|
Decompress.
|
|
|
|
.TP
|
|
|
|
.BR \-t ", " \-\-test
|
|
|
|
Test the integrity of compressed
|
|
|
|
.IR files .
|
|
|
|
This option is equivalent to
|
|
|
|
.B "\-\-decompress \-\-stdout"
|
|
|
|
except that the decompressed data is discarded instead of being
|
|
|
|
written to standard output.
|
|
|
|
No files are created or removed.
|
|
|
|
.TP
|
|
|
|
.B \-b#
|
|
|
|
benchmark file(s) using compression level #
|
|
|
|
.TP
|
|
|
|
.B \--train FILEs
|
|
|
|
use FILEs as training set to create a dictionary. The training set should contain a lot of small files (> 100).
|
|
|
|
|
|
|
|
.
|
|
|
|
.SS "Operation modifiers"
|
2015-01-24 00:58:16 +00:00
|
|
|
.TP
|
2015-12-17 19:30:14 +00:00
|
|
|
.B \-#
|
2016-10-28 20:58:31 +00:00
|
|
|
# compression level [1-19] (default:3)
|
2015-01-24 00:58:16 +00:00
|
|
|
.TP
|
2016-10-28 20:58:31 +00:00
|
|
|
.BR \--ultra
|
|
|
|
unlocks high compression levels 20+ (maximum 22), using a lot more memory
|
2015-01-24 00:58:16 +00:00
|
|
|
.TP
|
2016-02-16 13:42:08 +00:00
|
|
|
.B \-D file
|
|
|
|
use `file` as Dictionary to compress or decompress FILE(s)
|
2015-01-24 00:58:16 +00:00
|
|
|
.TP
|
2016-10-28 20:58:31 +00:00
|
|
|
.BR \--no-dictID
|
|
|
|
do not store dictionary ID within frame header (dictionary compression).
|
2016-11-01 01:10:32 +00:00
|
|
|
The decoder will have to rely on implicit knowledge about which dictionary to use,
|
|
|
|
it won't be able to check if it's correct.
|
2016-10-28 20:58:31 +00:00
|
|
|
.TP
|
2016-02-16 13:42:08 +00:00
|
|
|
.B \-o file
|
2016-06-02 15:05:50 +00:00
|
|
|
save result into `file` (only possible with a single INPUT-FILE)
|
2015-12-17 19:30:14 +00:00
|
|
|
.TP
|
2016-02-16 13:42:08 +00:00
|
|
|
.BR \-f ", " --force
|
|
|
|
overwrite output without prompting
|
2015-12-17 19:30:14 +00:00
|
|
|
.TP
|
2016-07-01 22:37:32 +00:00
|
|
|
.BR \-c ", " --stdout
|
|
|
|
force write to standard output, even if it is the console
|
|
|
|
.TP
|
2016-10-28 20:58:31 +00:00
|
|
|
.BR \--[no-]sparse
|
|
|
|
enable / disable sparse FS support, to make files with many zeroes smaller on disk.
|
2016-11-01 01:10:32 +00:00
|
|
|
Creating sparse files may save disk space and speed up the decompression
|
|
|
|
by reducing the amount of disk I/O.
|
2016-10-28 20:58:31 +00:00
|
|
|
default : enabled when output is into a file, and disabled when output is stdout.
|
|
|
|
This setting overrides default and can force sparse mode over stdout.
|
|
|
|
.TP
|
2016-07-01 22:37:32 +00:00
|
|
|
.BR \--rm
|
|
|
|
remove source file(s) after successful compression or decompression
|
|
|
|
.TP
|
|
|
|
.BR \-k ", " --keep
|
|
|
|
keep source file(s) after successful compression or decompression.
|
|
|
|
This is the default behavior.
|
|
|
|
.TP
|
|
|
|
.BR \-r
|
|
|
|
operate recursively on directories
|
|
|
|
.TP
|
2015-08-26 10:04:58 +00:00
|
|
|
.BR \-h/\-H ", " --help
|
2015-01-24 00:58:16 +00:00
|
|
|
display help/long help and exit
|
|
|
|
.TP
|
2015-08-26 10:04:58 +00:00
|
|
|
.BR \-V ", " --version
|
2015-01-24 00:58:16 +00:00
|
|
|
display Version number and exit
|
|
|
|
.TP
|
2015-08-26 10:04:58 +00:00
|
|
|
.BR \-v ", " --verbose
|
2015-01-24 00:58:16 +00:00
|
|
|
verbose mode
|
|
|
|
.TP
|
2015-12-17 19:30:14 +00:00
|
|
|
.BR \-q ", " --quiet
|
2016-07-28 17:55:09 +00:00
|
|
|
suppress warnings, interactivity and notifications.
|
|
|
|
specify twice to suppress errors too.
|
2015-01-24 00:58:16 +00:00
|
|
|
.TP
|
2016-10-28 20:58:31 +00:00
|
|
|
.BR \-C ", " --[no-]check
|
|
|
|
add integrity check computed from uncompressed data (default : enabled)
|
2016-06-02 15:05:50 +00:00
|
|
|
.TP
|
|
|
|
.BR \-t ", " --test
|
2016-07-01 22:37:32 +00:00
|
|
|
Test the integrity of compressed files. This option is equivalent to \fB--decompress --stdout > /dev/null\fR.
|
2016-06-02 15:05:50 +00:00
|
|
|
No files are created or removed.
|
2016-09-16 16:52:52 +00:00
|
|
|
.TP
|
|
|
|
.BR --
|
|
|
|
All arguments after -- are treated as files
|
|
|
|
|
2016-02-16 13:42:08 +00:00
|
|
|
|
2016-11-01 01:10:32 +00:00
|
|
|
.SH DICTIONARY BUILDER
|
2016-02-16 13:42:08 +00:00
|
|
|
.PP
|
|
|
|
\fBzstd\fR offers \fIdictionary\fR compression, useful for very small files and messages.
|
|
|
|
It's possible to train \fBzstd\fR with some samples, the result of which is saved into a file called `dictionary`.
|
|
|
|
Then during compression and decompression, make reference to the same dictionary.
|
|
|
|
It will improve compression ratio of small files.
|
|
|
|
Typical gains range from ~10% (at 64KB) to x5 better (at <1KB).
|
|
|
|
.TP
|
|
|
|
.B \--train FILEs
|
2016-10-28 20:58:31 +00:00
|
|
|
use FILEs as training set to create a dictionary. The training set should contain a lot of small files (> 100),
|
|
|
|
and weight typically 100x the target dictionary size (for example, 10 MB for a 100 KB dictionary)
|
2016-02-16 13:42:08 +00:00
|
|
|
.TP
|
|
|
|
.B \-o file
|
|
|
|
dictionary saved into `file` (default: dictionary)
|
2015-01-24 00:58:16 +00:00
|
|
|
.TP
|
2016-02-16 13:42:08 +00:00
|
|
|
.B \--maxdict #
|
2016-05-30 19:18:52 +00:00
|
|
|
limit dictionary to specified size (default : 112640)
|
|
|
|
.TP
|
|
|
|
.B \--dictID #
|
|
|
|
A dictionary ID is a locally unique ID that a decoder can use to verify it is using the right dictionary.
|
|
|
|
By default, zstd will create a 4-bytes random number ID.
|
|
|
|
It's possible to give a precise number instead.
|
|
|
|
Short numbers have an advantage : an ID < 256 will only need 1 byte in the compressed frame header,
|
|
|
|
and an ID < 65536 will only need 2 bytes. This compares favorably to 4 bytes default.
|
|
|
|
However, it's up to the dictionary manager to not assign twice the same ID to 2 different dictionaries.
|
2016-02-16 13:42:08 +00:00
|
|
|
.TP
|
|
|
|
.B \-s#
|
|
|
|
dictionary selectivity level (default: 9)
|
|
|
|
the smaller the value, the denser the dictionary, improving its efficiency but reducing its possible maximum size.
|
|
|
|
|
|
|
|
.SH BENCHMARK
|
2015-01-24 00:58:16 +00:00
|
|
|
.TP
|
2015-12-17 19:30:14 +00:00
|
|
|
.B \-b#
|
|
|
|
benchmark file(s) using compression level #
|
2015-01-24 00:58:16 +00:00
|
|
|
.TP
|
2016-10-28 20:58:31 +00:00
|
|
|
.B \-e#
|
|
|
|
benchmark file(s) using multiple compression levels, from -b# to -e# (included).
|
|
|
|
.TP
|
2015-01-24 00:58:16 +00:00
|
|
|
.B \-i#
|
2016-08-01 11:37:17 +00:00
|
|
|
minimum evaluation time, in seconds (default : 3s), benchmark mode only
|
2016-02-16 13:42:08 +00:00
|
|
|
.TP
|
|
|
|
.B \-B#
|
|
|
|
cut file into independent blocks of size # (default: no block)
|
|
|
|
|
2015-01-24 00:58:16 +00:00
|
|
|
|
|
|
|
.SH BUGS
|
2016-09-03 05:11:49 +00:00
|
|
|
Report bugs at:- https://github.com/facebook/zstd/issues
|
2015-01-24 00:58:16 +00:00
|
|
|
|
|
|
|
.SH AUTHOR
|
|
|
|
Yann Collet
|