How Do I Bzip2 a Directory in Linux?
Contents

How bzip2 file in Linux?

bzip2 command in Linux with Examples

  1. -z : This option forces compression. …
  2. -k: This option does compression but does not deletes the original file. …
  3. -d : This option is used for decompression of compressed files. …
  4. -t : This option does the integrity check of the file and does not decompresses the file.

How do I compress a folder in bzip2?

Compress a directory

This example creates a compressed etc. tar. bz2 file of the entire /etc/ directory. The tar flags are as follows, ‘c’ creates a new tar archive, ‘j‘ specifies that we want to compress with bzip2, ‘v’ provides verbose information, and ‘f’ specifies the file to create.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest