How to convert a file of format tar.gz to tar.bz2?

2

Like the title says, how do I do this conversion from the Linux console?

Chase T.

Posted 2014-01-17T16:26:36.943

Reputation: 123

Answers

8

You can combine the two commands as following:

gunzip < file.gz | bzip2 > file.bz2

This will start two processes in parallel, gunzip reading the file.gz file and outputting the non-compressed stream to bizp2 to re-compress it into file.bz2.

This process does not create intermediate files, you'll need to remove the file.gz afterwards (rm file.gz).

aularon

Posted 2014-01-17T16:26:36.943

Reputation: 428

Doesn't seem to work on Mac: No such file or directory for the new archive. – Peter Ilfrich – 2016-12-20T06:55:55.860