bzip2
From NetBSD Wiki
The bzip2(1) tool uses the Burrows-Wheeler algorithm to compress or decompress files. When invoked with the bzip2 command, it will default to compression. It can also be invoked as bunzip2, defaulting to decompression.
Contents |
Compressing
To compress a file, you can run:
$ bzip2 test.txt
This will replace test.txt with a compressed version of the file, called test.txt.bz2.
Decompressing
To decompress, run:
$ bunzip2 test.txt.bz2
The compressed version will then be replaced with the original test.txt.
The -d option to bzip2 has the sam effect as running bunzip2.
$ bzip2 -d test.txt.bz2
Writing to stdout
The bzip2 program can also be invoked as bzcat, in which case it will print the decompressed file on stdout.
$ bzcat test.txt.bz2 This is the content of test.txt
