Fundamentals 6 min read

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.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Install and Use Zstandard (zstd) for Fast File Compression on Linux

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 upgrade

Install build essentials, wget and tar:

sudo apt install build-essential wget tar

Debian / Ubuntu / Linux Mint

sudo apt install zstd

Fedora / Red Hat / CentOS / AlmaLinux

sudo dnf install zstd

Arch Linux / Manjaro

sudo pacman -S zstd

After 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.log

Sample 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.log

Or compress all matching files:

sudo zstd *.log

Decompressing 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.zst

Ensure 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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxzstdFile Compression
Liangxu Linux
Written by

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.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.