Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

up vote 13 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
2  
And GZ to BZip2: gunzip -c < file.tar.gz | bzip2 -c > file.tar.bz2 – Le Quoc Viet Oct 17 '12 at 2:50

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

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

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .