Tag Archive for: create tar.gz file

Most Used Linux Commands For File Compression


Compress a file with gzip

$ gzip filename

Compress and keep the original file

$ gzip -c file > file.gz

Compress all files in a folder

$ gzip -r foldername


$ tar -czvf filename.tar.gz directory

ZSTD Compression

Install first the package,

$ sudo apt install zstd (Debian/Ubuntu)

$ dnf install zstd (Centos,AlmaLinux,Fedora,Redhat)


to compress a file :

zstd example.txt

Using with tar:

tar --zstd example.tar.zst example/