Zstandard in short zstd is a new small and faster data compression tool developed by Facebook. It is an implementation of a new data compression algorithm. zstd also offers highly configurable compression speed, with the fast modes at > 200 MB/s. It also features a very fast decoder, with speeds > 500 MB/s per core.
The Ubuntu users can install it directory from base repositories. Open a terminal and run the following command to install zstd on Debian based systems.
sudo apt install zstd
Use following commands to install Zstd on CentOS, Red Hat and Fedora systems.
sudo yum install zstd ## CentOS, RedHat systems sudo dnf install zstd ## Fedora systems
For the Linux systems don’t include zstd packages to there repositories can compile from source. Download the latest Zstandard release from GitHub and extract on your system. Now compile it using make.
cd zstd-1.3.4 sudo make install
Using Zstd Compression Tool
Use zst followed by the filename to compress. This will create a compressed file with appending .zst extension to the original filename.
You can also specify the output compressed filename with
-o command line parameter.
zstd filename -o newfile.zst
To uncompress any file compressed with zstandard. Use -d option with zstd or directory use unzstd command directory.
zstd -d filename.zst unzstd filename.zst
Zstandard Comparison with Other Tools
Here I did a comparison between the zip, tar, and zstd archiving tools and found that zstd is faster and than others. I used a 508 Mb backup file and here are results and got the following results.
The zstd takes 5 seconds to compress and created a 119 Mb compressed file.
For the same file, tar takes 23 seconds to compress and created a 150 Mb compressed file.
And zip takes 22 seconds to compress and created a 150 Mb compressed file. So it looks tar and zip take approx same time here.
As per the above comparison, zstd is much faster than other compression tools and provider higher compression of data. So we can assume that zstd may replace the current compression tools in future.