56

I'm downloading an engine game file which is compressed as .tar.bz2.

I'm trying this command

tar -zxvf enginsxt.tar.bz2

And it throws an error. I know that command

tar -zxvf

is only for extracting .tar.gz files, but how can I decompress this one?

WapDL
  • 571

1 Answers1

86

Have you checked the man page for tar?

Here is the part that I extracted from man page of tar for bz2:

-j, --bzip2
          filter the archive through bzip2

Remove -z from your options and (optionally) add -j to extract your tar archive correctly:

tar -xvjf enginsxt.tar.bz2
Zanna
  • 70,465
ostendali
  • 1,158
  • 5
    It still needs the f as the last option letter before the filename I think: either xvjf or plain xvf (or even xf if you don't care about verbosity) since tar is smart enough to figure out the compression type... except when wrong-footed with an erroneous type, as the OP did. – steeldriver Dec 09 '15 at 19:53
  • that is right, kinda missed that, but he can figure that out from man page:-) – ostendali Dec 10 '15 at 09:25
  • Out of all letters, how did they arrive to j? – Neinstein Jul 22 '22 at 09:57