Selected topic
Archiving And Compression
Prefer practical output? Use related tools below while reading.
bzip2 is a lossless data compression utility that uses the Burrows-Wheeler algorithm to compress files. It is designed to be fast and efficient, making it suitable for large files.
bzip2 compresses files without losing any original data.bzip2 can achieve higher compression ratios than other lossless algorithms like gzip.bzip2 is designed to be fast, making it suitable for large files.bzip2 command is:
bash
bzip2 [options] file
Here are some common options:-c: Compress or decompress from standard input/output.-d: Decompress a file (inverse of compression).-6, -7, etc.: Specify the compression level (1-9, where 1 is fastest and 9 is highest compression).example.txt using bzip2. We can use the following command:
bash
bzip2 -6 example.txt
This will create a new file called example.txt.bz2 that contains the compressed data.To decompress the file, we can use the -d option:
bash
bzip2 -d example.txt.bz2example.txt file from the compressed version.-6, -7, etc. options.--preserve option.