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've a file

I tried to extract it with

$ tar xjvf

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 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
Try file 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 Sreedharan Nov 29 '11 at 10:31
up vote 6 down vote accepted

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

You can decompress using the following command:

tar xvf

What probably happened here is that 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

You must log in to answer this question.

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