bzip2 is specifically designed for compressing and decompressing bz2 files (with a ".bz2" file extension). bzip2 typically achieves higher compression ratios compared to another compression tool, gzip. Commonly used options and parameters include "-d" for decompression, "-[1~9]" to specify compression levels (higher numbers result in higher compression ratios), and "-c" to output to standard output.
Example:
$ bzip2 * ←Compress all files in the current working directory $ bzip2 -d *.bz2 ←Decompress all ".bz2" files in the current working directory $ bzip2 -9 *.cpp ←Compress all ".cpp" files in the current working directory with compression level 9 |