Sign up ×
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 Sep 28 '12 at 19:42

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

6 Answers 6

up vote 184 down vote accepted

Try the following:

bzip2 -d filename.bz2

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

share|improve this answer
bzip2 -dk filename.bz2 keep original file. – Trindaz Sep 18 '14 at 18:28

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 *.txt

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

share|improve this answer
Excellent advice about the xjvf, just saved me. Thanks! – Edgar Aroutiounian Aug 17 '13 at 3:22
You can just use tar xjf filename.tar.bz2. The v just adds verbose output. Keep your terminal clean! I also had problems running tar -xjf, so be sure to try running it sans the - – MrOodles Jan 15 at 15:14
tar xf should be sufficient with the BSD variant — the j flag is only used when compressing – Mark Fox Oct 30 at 0:16

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

share|improve this answer

Use bunzip2:

share|improve this answer
This isn't really a solution. It's just a hint and a link so someone can figure out their own solution. Since other answer provide actual solutions, this post adds no value. – fixer1234 May 21 at 17:22
bzip2 -dc my_file.tar.bz2 | tar xvf -

worked for me on cygwin

share|improve this answer
It would be helpful if you could add a few sentences to your answer to explain what it does. – fixer1234 May 21 at 17:25

Just give tar -xvf "file_name"

share|improve this answer
Welcome to SuperUser! Thanks for posting an answer. However, the original asker indicated one problem is that the file is not a tar, and thus tar chokes on it. – Brian Jun 30 at 14:06

Your Answer


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.