Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Do I need to compress and decompress all content?

share|improve this question

migrated from stackoverflow.com Nov 16 '11 at 7:59

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers

up vote 9 down vote accepted
bunzip2 -c < file.tar.bz2 | gzip -c > file.tar.gz
share|improve this answer
    
this is nice too! :-) –  Jasonw Nov 16 '11 at 5:50
1  
And GZ to BZip2: gunzip -c < file.tar.gz | bzip2 -c > file.tar.bz2 –  Le Quoc Viet Oct 17 '12 at 2:50
add comment

You need to decompress, and then compress.

You can convert like so:

 bunzip2 -c -d file.tar.bz2 | gzip -v9 > file.tar.gz
share|improve this answer
    
this is nice! :-) –  Jasonw Nov 16 '11 at 5:48
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.