Forrest logo
tool overview
On this page you find all important commands for the CLI tool bzip2. If the command you are looking for is missing please ask our AI.

bzip2

bzip2 is a command line tool used for file compression and decompression. It uses the Burrows-Wheeler algorithm and Huffman coding to effectively compress files while preserving their integrity.

Key features of bzip2 include:

  1. Compression: bzip2 can compress files into a smaller size, reducing the overall disk space required to store them. It typically achieves higher compression ratios compared to traditional compression algorithms like gzip.

  2. Decompression: Files compressed with bzip2 can be easily decompressed to restore their original contents.

  3. Efficiency: The algorithm used by bzip2 is computationally efficient and works well with large files. It employs block-sorting techniques to enhance the compression process.

  4. Integrity: bzip2 ensures the integrity of compressed files by using a combination of CRC32 checksums and run-length encoding. These mechanisms help detect and handle errors during compression and decompression.

  5. Cross-platform: bzip2 is available for various operating systems, including Linux, macOS, and Windows. It is widely supported by different software applications and can be integrated into different workflows.

To use bzip2, you typically run it from the command line with different options and arguments. The basic syntax for compressing a file is:

bzip2 [options] filename

Similarly, the syntax for decompressing a file is:

bunzip2 [options] filename.bz2

The options allow you to specify different behaviors, such as adjusting compression levels, preserving file attributes, or showing progress during the operation.

bzip2 is commonly used for compressing large text files, log files, archives, and software distributions. It provides a balance between compression ratio and speed, making it a popular choice for file compression in command line environments.

List of commands for bzip2:

  • bzip2:tldr:1c774 bzip2: Show the compression ratio for each file processed with detailed information.
    $ bzip2 --verbose ${path-to-compressed_files-bz2}
    try on your machine
    explain this command
  • bzip2:tldr:358d3 bzip2: Compress a file.
    $ bzip2 ${filename_to_compress}
    try on your machine
    explain this command
  • bzip2:tldr:47c1e bzip2: Decompress a file.
    $ bzip2 -d ${path-to-compressed_file-bz2}
    try on your machine
    explain this command
  • bzip2:tldr:9b85d bzip2: Test the integrity of each file inside the archive file.
    $ bzip2 --test ${path-to-compressed_file-bz2}
    try on your machine
    explain this command
  • bzip2:tldr:a8d4d bzip2: Decompress a file overwriting existing files.
    $ bzip2 --force ${path-to-compressed_file-bz2}
    try on your machine
    explain this command
  • bzip2:tldr:d2b12 bzip2: Display help.
    $ bzip2 -h
    try on your machine
    explain this command
  • bzip2:tldr:d7820 bzip2: Decompress a file to standard output.
    $ bzip2 -dc ${path-to-compressed_file-bz2}
    try on your machine
    explain this command
tool overview