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've a data_or.tar.bz file

I tried to extract it with

$ tar xjvf data_or.tar.bz

Output is

bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Can only bz2 files be extracted with tar command?

-- update

$ file data_or.tar.bz 
data_or.tar.bz: POSIX tar archive (GNU)
share|improve this question
    
maybe it was wrongly named? if you feel lucky try tar xzvf ... or tar xvf ... - otherwise maybe a look into the head may reveal details. –  bdecaf Nov 29 '11 at 10:14
4  
Try file data_or.tar.bz which should tell you if the file is simply a mis-named archive of a different type. –  Mokubai Nov 29 '11 at 10:18
    
@Mokubai [lease see updated question –  Mithun Nov 29 '11 at 10:31
add comment

1 Answer

up vote 5 down vote accepted

Your tarball is uncompressed. The extension .bz is obsolete and misleading.

You can decompress using the following command:

tar xvf data_or.tar.bz

What probably happened here is that data_or.tar.bz was created with the --auto-compress switch (or tar -cavf) that chooses the compression algorithm from the supplied extension.

The proper extension for bzip2 compressed files is .bz2, while the .bz extension is for bzip compressed files.

bzip uses arithmetic encoding (which is a patented algorithm), so bzip2 was created in 1997 as a patent-free alternative. As a result, bzip2 and bzip are incompatible.

tar cannot handle bzip (de)compression, so the --auto-compress switch resulted in an uncompressed tarball.

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.