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 have a file as: filename.bz2, but I can't figure out how to decompress it. I tried several methods, none of them seems work.

I have tried the command: tar xvjf filename.tar.bz2, but it didn't work as the file is not a tar file. Would anyone know how to decompress this file?

share|improve this question

migrated from stackoverflow.com Sep 28 '12 at 19:42

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

add comment

4 Answers

up vote 54 down vote accepted

Try the following:

bzip2 -d filename.bz2

Note, that this command will not preserve original archive file.

share|improve this answer
add comment

Use the bunzip2 (or bzip2 -d) command to decompress the file. For more information see this man page,

share|improve this answer
add comment

Just to explain a bit further, a single file can be compressed with bzip2 thus:

bzip2 myfile.txt

tar is only required when compressing multiple files:

tar cvjf myfile.tar.bz *.txt

Hence, when uncompressing a .bz2 file use bunzip, when uncpresssing a tar.bz2 file use tar xjvf.

share|improve this answer
1  
Excellent advice about the xjvf, just saved me. Thanks! –  Edgar Aroutiounian Aug 17 '13 at 3:22
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.