Why I Can't Uncompress A. Bz2 File Using Tar?
So I Have This Wikipedia Dump Sized at About 10Gb and Named as "Enwiki-Latest-Pages-Articles. Xml. Bz2". I Have Been Trying the Following Commands in the...
So I have this wikipedia dump sized at about 10gb and named as "enwiki-latest-pages-articles.xml.bz2". I have been trying the following commands in the terminal to unzip the dump:
tar jxf enwiki-latest-pages-articles.xml.bz2
And
tar xvf enwiki-latest-pages-articles.xml.bz2
But both of them returns the following error
tar: This does not look like a tar archive
tar: Skipping to next header
2 Answers
You can't use the tar command because the archive isn't a .tar.* file. To uncompress a bzip2 file, use the following command (this won't preserve the original .bz2 file):
bzip2 -d enwiki-latest-pages-articles.xml.bz2
If you want to extract it and keep the original, run this command:
bzip2 -dk enwiki-latest-pages-articles.xml.bz2
Source:
Just use bunzip2:
bunzip2 enwiki-latest-pages-articles.xml.bz2
And if its a gzip commpressed file:
gunzip enwiki-latest-pages-articles.xml.gz