Using Data Compression in Linux

Опубликовано: 14 Март 2026
на канале: SecureRandom
726
26

Compression is a way of reducing the size of a file using different algorithms and mathematical calculations. Some of the benefits of using compression are conserving disk space and using less bandwidth for network communication.

In this video we go over how to use gzip, bzip2, and xz in Linux then describe some use cases for each.

Support the channel:
BTC - 3NzWDDH3n5PsBKqWJyAb7rvsGvJKxcAPFv

Follow me:
SecureRandom on YouTube -
   / @securerandom5420  

SecureRandom on LBRY / Odysee -
https://odysee.com/@SecureRandom:1

------------------------------------------------------------------

Commands used in this video:

Compressing files with gzip
$ gzip file.txt
$ gzip -k file.txt # use -k to not delete the original file
$ gzip -c file.txt # use to send the stream to stdout

$ gunzip file.txt.gz # can also use -d


Compressing files with bzip2
$ bzip2 file.txt
$ bzip2 -k file.txt # use -k to not delete the original file

$ bunzip2 file.bz


Compressing files with xz
$ xz file.txt
$ xz -k file.txt # use -k to not delete the original file

$ unxz file.zx
$ xz -d file.xz # this is recommended for scripts