Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bunzip / bzip2 an entire directory instead of individual files in the directory

Tags:

gzip

bzip2

With gunzip its simply zip -r archive.zip my_dir/. Am failing to find an equivalent command for bunzip. Some if found are zipping individual files inside of a directory, but i want one .bzip2 archive.

like image 328
Pratik Khadloya Avatar asked Oct 16 '25 13:10

Pratik Khadloya


1 Answers

gunzip is not zip. zip is an archiver which handles files and directories. gzip/gunzip only compresses a single file or stream of data.

bzip2 is just like gzip, and only compresses a single file or stream of data. For both gzip and bzip2, it is traditional to use tar as the archiving program, and compressing the output. In fact that is such a common idiom that tar has options to invoke gzip or bzip2 for you. Do a man tar.

like image 123
Mark Adler Avatar answered Oct 19 '25 12:10

Mark Adler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!