Install and Use Zstandard (zstd) for Fast File Compression on Linux
This guide explains what Zstandard (zstd) is, shows how to install it on major Linux distributions, and provides step‑by‑step commands for compressing single or multiple files, checking compression ratios, and decompressing archives safely.
What is Zstandard (zstd)?
Zstandard, abbreviated as zstd, is a high‑performance data compression tool created by Facebook engineers in 2015. It is widely adopted on Linux because it offers fast compression and decompression with good compression ratios.
Installing zstd on Linux
Before using zstd, ensure your system is up to date and install required build tools.
Update the package index and upgrade existing packages (Debian/Ubuntu based):
sudo apt update sudo apt upgradeInstall build essentials, wget and tar:
sudo apt install build-essential wget tarDebian / Ubuntu / Linux Mint
sudo apt install zstdFedora / Red Hat / CentOS / AlmaLinux
sudo dnf install zstdArch Linux / Manjaro
sudo pacman -S zstdAfter installation, zstd is ready for use.
Compressing Files with zstd
Compress a single file by running: zstd filename This creates filename.zst. Example:
cd /var/log sudo zstd alternatives.logSample output shows the compression factor:
[sudo] password for linuxmi:
alternatives.log : 17.94% ( 2737 => 491 bytes, alternatives.log.zst)Compressing Multiple Files
List the files separated by spaces, or use a wildcard:
sudo zstd vmware-network.1.log vmware-network.2.log vmware-network.3.log vmware-network.4.logOr compress all matching files:
sudo zstd *.logDecompressing Files
To restore a compressed file, use the -d option or the unzstd command:
sudo zstd -d vmware-install.log.zst sudo unzstd vmware-install.log.zstEnsure the target file does not already exist, otherwise zstd will prompt before overwriting.
Summary
This tutorial demonstrated how to install the Zstandard utility on various Linux distributions and how to compress and decompress files, including handling multiple files and using wildcards.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
