红穆笔记

zstd

使用 Zstandard 壓縮來壓縮 / 解壓文件

100% 瀏覽器本地處理 0 數據上傳

常用示例

將一個文件壓縮到一個 `.zst` 後綴的壓縮文件中

zstd {{file}}

解壓縮一個文件

zstd --decompress {{file.zst}}

將文件解壓縮到標準輸出(`stdout`)

zstd --decompress --stdout {{file.zst}}

使用指定的壓縮等級來壓縮一個文件.0 = 最差,19 = 最好(默認等級是 3)

zstd -{{level}} {{file}}

使用更多內存(解壓或壓縮時)來得到更高的壓縮比

zstd --ultra -{{level}} {{file}}

提示:花括號{{…}}是需要替換的參數(路徑、文件名等);命令只在本機終端執行,本站不保存任何輸入。

英文原文對照

展開英文說明與示例(來源 tldr-pages)

Compress or decompress files with Zstandard compression. More information

Compress a file into a new file with the `.zst` suffix

zstd {{path/to/file}}

Decompress a file

zstd {{[-d|--decompress]}} {{path/to/file.zst}}

Decompress to `stdout`

zstd {{[-d|--decompress]}} {{[-c|--stdout]}} {{path/to/file.zst}}

Compress a file specifying the compression level, where 1=fastest, 19=slowest, and 3=default

zstd -{{1..19}} {{path/to/file}}

Compress a file using an ultra-fast compression level, where 1=default

zstd --fast={{1..131072}} {{path/to/file}}

Unlock higher compression levels (up to 22) using more memory (both for compression and decompression)

zstd --ultra -{{1..22}} {{path/to/file}}

Set the number of working threads to the number of physical CPU cores

zstd {{[-T|--threads]}} 0

命令信息

命令名zstd
用途使用 Zstandard 壓縮來壓縮 / 解壓文件
適用平臺通用
示例數量5 條
官方文檔https://manned.org/zstd
數據來源tldr-pages(CC-BY-4.0)· 社區中文翻譯

常見問題

zstd 命令是做什麼的?

使用 Zstandard 壓縮來壓縮 / 解壓文件

zstd 怎麼用?

頁面按場景列出了5 條常用示例:每條示例先說明用途,再給出可直接複製的完整命令(花括號裏是需要替換的參數)。

zstd 最常用的操作是什麼?

將一個文件壓縮到一個 `.zst` 後綴的壓縮文件中:zstd {{file}}

命令裏的花括號是什麼意思?

花括號{{…}}表示需要替換成你自己的值,例如路徑、文件名;同名參數方括號(如 [-C|--directory])表示可選寫法。