You are reading the article How To Compress Files With Zstd Utility In Linux updated in September 2023 on the website Dacvumuahe.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested October 2023 How To Compress Files With Zstd Utility In Linux
Although there are many graphical and command-line data compression tools, zstd is the one that stands out. Short for Zstandard, zstd is a data compression tool developed by Facebook data engineers in 2023. It is so effective and easy to use, that zstd has become the go-to compression tool for many Linux users. This tutorial will show you how to install zstd and use it from the terminal.
How to Install zstd on Various Linux distrosBefore you can use zstd, you need to install it – if you don’t have it already installed on your Linux distro.
Fortunately, installing zstd is as simple as executing a couple of commands.
Note: based on which Linux distro you’re running, you may have to install dependencies and various tools before compiling and installing zstd. That’s why the first thing you should do is update your system. For Debian and Ubuntu-based distro, you can use the update and upgrade commands:
sudo
apt update
sudo
apt upgrade
To ensure that you have all the dependencies that zstd needs, install build-essentials, wget, and tar using the command:
sudo
apt
install
build-essentialwget
tar
Now that you have the all the required dependencies and tools installed, you can move on and install zstd.
On Debian/Ubuntu/Linux MintTo install zstd on a Debian/Ubuntu/Linux Mint system, execute the command:
sudo
apt
install
zstd On Fedora/Red Hat/CentOS/AlmaLinuxTo install Zstandard on Fedora/Red Hat/CentOS/AlmaLinux systems, execute the command;
sudo
dnf
install
zstd On Arch Linux/ManjaroTo install zstd on Arch Linux/Manjaro systems, execute the command:
sudo
pacman-S
zstdNow that we have zstd installed and ready to go, we can start using it to compress files.
Compressing Files with zstdUsing zstd to compress a file is easy. All you have to do is execute the command zstd [filename]. Using the above command creates a new, compressed file with the .zst extension.
For example, to compress a “samplecompression.text” in the “/var/log” directory, we would execute the command:
cd
/
var/
logsudo
zstd samplecompression.textthe following is an example output:
The above output shows the compression factor, i.e 44.08% from 1141 bytes for 503 bytes.
Compressing Multiple FilesTo use zstd to compress multiple files simultaneously, all you have to do is specify the files you want to compress, separated by a space between them.
For example, to compress “compress.txt,” “compress2.txt,” “compress3.txt,” and “compress4.txt”:
sudo
zstd chúng tôi chúng tôi chúng tôi chúng tôi can also use the wildcard “*” to compress all the files and folders within your current/specified directory. For example:sudo
zstd*
.txt Decompressing Files with zstdWhen you need to decompress a file with zstd, use the -d option or unztd.
For example, to decompress the file used throughout this guide, you would use any of the following commands:
sudo
zstd
-d
samplecompression.text.zst
sudo
unzstd chúng tôi the source of the file from the archive does not exist, or zstd will prompt you to overwrite the existing file.
ConclusionThis tutorial has illustrated how to compress and decompress files using the zstd utility. Meanwhile, you can learn how to extract zip files in Linux.
John Wachira
John is a technical writer at MTE, when is not busy writing tech tutorials, he is staring at the screen trying to debug code.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.
You're reading How To Compress Files With Zstd Utility In Linux
Update the detailed information about How To Compress Files With Zstd Utility In Linux on the Dacvumuahe.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!