13

I'm new in Linux, is this conversion possible?

Do I need to compress and decompress all content?

Tamara Wijsman
  • 57,083
  • 27
  • 185
  • 256
Caio Tarifa
  • 233
  • 1
  • 2
  • 5
  • You might consider using `xz` instead of `gzip` as it can compress better at the expense of using more time and memory. – jftuga Oct 21 '16 at 22:42

3 Answers3

21
bunzip2 -c < file.tar.bz2 | gzip -c > file.tar.gz
Jeff Ferland
  • 843
  • 6
  • 12
6

You need to decompress, and then compress.

You can convert like so:

 bunzip2 -c -d file.tar.bz2 | gzip -v9 > file.tar.gz
0

Yes, you need to decompress and compress the content (because compression is not "compositional").