How do I convert tar.bz2 to tar.gz?
19,402
Solution 1
bunzip2 -c < file.tar.bz2 | gzip -c > file.tar.gz
Solution 2
You need to decompress, and then compress.
You can convert like so:
bunzip2 -c -d file.tar.bz2 | gzip -v9 > file.tar.gz
Related videos on Youtube
Author by
Caio Tarifa
Updated on September 18, 2022Comments
-
Caio Tarifa over 1 year
I'm new in Linux, is this conversion possible?
Do I need to compress and decompress all content?
-
jftuga over 7 yearsYou might consider using
xz
instead ofgzip
as it can compress better at the expense of using more time and memory.
-
-
Admin over 12 yearsthis is nice! :-)
-
Admin over 12 yearsthis is nice too! :-)
-
Le Quoc Viet over 11 yearsAnd GZ to BZip2:
gunzip -c < file.tar.gz | bzip2 -c > file.tar.bz2
-
jftuga over 7 yearsAlso consider
gzip -9 -c ...
for tighter compression.