zstd 命令详解

| 选择喜欢的代码风格  

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

zstd 命令安装:


-bash/zsh: zstd command not not found

# Windows (WSL2)
sudo apt-get update sudo apt-get install zstd

# Debian
apt-get install zstd

# Ubuntu
apt-get install zstd

# Alpine
apk add zstd

# Arch Linux
pacman -S zstd

# Kali Linux
apt-get install zstd

# Fedora
dnf install zstd

# OS X
brew install zstd

# Raspbian
apt-get install zstd

# Dockerfile
dockerfile.run/zstd

# Docker
docker run cmd.cat/zstd zstd

zstd 命令补充说明:


Zstandard 是一种快速压缩算法,可提供高压缩比。它还提供了一种针对小数据的特殊模式,称为字典压缩。参考库提供了非常广泛的速度 / 压缩比权衡,并由极快的解码器支持。Zstandard 库以开源软件的形式提供,使用 BSD 许可证。其格式稳定,并以 IETF RFC 8878 的形式发布。

Zstandard 的格式稳定,并已记录在 RFC8878 中。目前已有多个独立实现。此存储库代表参考实现,以开源 BSD 或 GPLv2 许可的 C 库形式提供,以及用于生成和解码 .zst.gz.xz.lz4 文件的命令行实用程序。如果您的项目需要其他编程语言,Zstandard 主页上提供了已知端口和绑定的列表。

zstd 命令选项:


-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, unzstd implies --decompress).

-d, --decompress, --uncompress
      Decompress.

-t, --test
      Test the integrity of compressed files. This option is equivalent to --decompress --stdout > /dev/null, decompressed data is discarded and checksummed for errors. No files are created or removed.

-b#
      Benchmark file(s) using compression level #. See BENCHMARK below for a description of this operation.

--train FILES
      Use FILES as a training set to create a dictionary. The training set should contain a lot of small files (> 100). See DICTIONARY BUILDER below for a description of this operation.

-l, --list
      Display information related to a zstd compressed file, such as size, ratio, and checksum. Some of these fields may not be available. This command´s output can be augmented with the -v modifier.

zstd 命令实例:


zstd 将文件压缩为带有 .zst 后缀的新文件:

zstd path/to/file

zstd 解压缩文件:

zstd --decompress path/to/file.zst

zstd 解压缩到 stdout

zstd --decompress --stdout path/to/file.zst

zstd 压缩文件并指定压缩级别,其中 1=最快,19=最慢,3=默认

zstd -level path/to/file

zstd 使用更多内存(用于压缩和解压缩)解锁更高的压缩级别(最高 22 级):

zstd --ultra -level path/to/file

zstd 多种编程语言支持

LanguageAuthorURL
Python (full) Gregory Szorc https://pypi.python.org/pypi/zstandard
Python (simple) Sergey Dryabzhinsky https://github.com/sergey-dryabzhinsky/python-zstd
Python (bz2 api) Ma Lin https://pypi.org/project/pyzstd
Rust Alexandre Bury https://crates.io/crates/zstd
Rust (Port) Moritz Borcherding https://github.com/KillingSpark/zstd-rs
Java Luben Karavelov https://github.com/luben/zstd-jni
Java (Port) Martin Traverso https://github.com/airlift/aircompressor/tree/master/src/main/java/io/airlift/compress/v3/zstd
C# SKB Kontur https://github.com/skbkontur/ZstdNet
C# (streaming) Bernhard Pichler https://github.com/bp74/Zstandard.Net
C# (signed) Tyler Young https://github.com/ImpromptuNinjas/ZStd
C# (Port) Oleg Stepanischev https://github.com/oleg-st/ZstdSharp
C (winXP) jimmyleocn https://github.com/jimmyleocn/zstd-winxp
Javascript (emscripten) Yoshihito https://www.npmjs.com/package/zstd-codec
Javascript (decoder, Port) Arjun Barrett https://www.npmjs.com/package/fzstd
Javascript (decoder, wasm) Don McCurdy https://www.npmjs.com/package/zstddec
Javascript (wasm, asm) Szende, Tamas, Szabo & Zana https://www.npmjs.com/package/@oneidentity/zstd-js
Node.js MongoDB-js https://github.com/mongodb-js/zstd
Node.js Tyler Stiene https://www.npmjs.com/package/simple-zstd
Go (Port) Klaus Post https://github.com/klauspost/compress/tree/master/zstd#zstd
Go Vianney Tran https://github.com/DataDog/zstd
Go (+dict) Aliaksandr Valialkin https://github.com/valyala/gozstd
PHP Kamijo https://github.com/kjdev/php-ext-zstd
PHP John Wedgbury https://github.com/appoly/zstd-php
Fortran Philippe Engel https://github.com/interkosmos/fortran-zstd
Pascal Denis Anisimov https://github.com/DenisAnisimov/ZSTD.pas
Delphi Xelitan https://github.com/Xelitan/ZSTD-compression-decompression-for-Delphi-Lazarus
Swift Anatoli Peredera https://github.com/omniprog/SwiftZSTD
Ruby SpringMT https://github.com/SpringMT/zstd-ruby
Ruby (FFI) Michael Sievers https://github.com/msievers/zstandard-ruby
Ruby (stream) Andrew Aladjev https://rubygems.org/gems/ruby-zstds
R Konstantin Sorokin https://cran.r-project.org/web/packages/zstdr/index.html
Perl Jiro Nishiguchi https://metacpan.org/release/Compress-Zstd
Visual Basic 6 Tanner Helland https://github.com/tannerhelland/VB6-Compression
Objective C Micha Mazaheri https://github.com/luckymarmot/ZstdKit
Lisp Guillaume Le Vaillant https://github.com/glv2/cl-zstd
Ada John Marino https://github.com/jrmarino/zstd-ada
Dart Instantiations https://pub.dev/documentation/es_compression/latest/zstd/zstd-library.html
Scala (Port, decoder) Johannes Rudolph https://github.com/jrudolph/decoders/blob/main/src/main/scala/net/virtualvoid/codecs/zstd/Zstd.scala
Julia Kenta Sato https://github.com/bicycle1885/CodecZstd.jl
D Masahiro Nakagawa https://code.dlang.org/packages/zstd
Lua Soojin Nam https://github.com/sjnam/lua-resty-zstd
Haskell Bryan O'Sullivan https://github.com/facebookexperimental/hs-zstd
Erlang Silviu Caragea https://github.com/silviucpp/ezstd
Erlang Yuki Ito https://hex.pm/packages/zstd
Tcl D. Bohdan https://wiki.tcl-lang.org/48788
SmallTalk Instantiations http://www.instantiations.com/resources/goodies.html#instantiations
Elixir chenzhuoyu https://hex.pm/packages/ex_zstd
OCaml Jane Street https://opam.ocaml.org/packages/zstandard/
Crystal @didactic-drunk https://github.com/didactic-drunk/zstd.cr
Nim wltsmrz https://github.com/wltsmrz/nim_zstd
Racket Vincent Lee https://pkgs.racket-lang.org/package/zstd

zstd 命令扩展阅读:


 

CommandNotFound ⚡️ 坑否 - 其他频道扩展阅读:




zstd 命令评论

共收录到 539Linux 命令