The Computer Oracle

How to decompress a .bz2 file

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: The World Wide Mind

--

Chapters
00:00 Question
00:28 Accepted answer (Score 680)
00:50 Answer 2 (Score 75)
01:23 Answer 3 (Score 24)
01:40 Answer 4 (Score 20)
03:59 Thank you

--

Full question
https://superuser.com/questions/480950/h...

Answer 2 links:
[man page]: https://www.freebsd.org/cgi/man.cgi?quer

Answer 3 links:
[lbzip2]: http://lbzip2.org/
[pbzip2]: http://compression.ca/pbzip2/
[mpibzip2]: http://compression.ca/mpibzip2
https://dumps.wikimedia.org/mirrors.html
http://vbtechsupport.com/1614/
[image]: https://i.stack.imgur.com/6Md2N.png
[http://explainshell.com/explain?cmd=lbzi...]: http://explainshell.com/explain?cm
[image]: https://i.stack.imgur.com/O7udu.png

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #compression #bzip2

#avk47



ACCEPTED ANSWER

Score 735


Try the following:

bzip2 -d filename.bz2

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

To preserve the original archive, add the -k option:

bzip2 -dk filename.bz2



ANSWER 2

Score 79


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 myfile.tar.bz *.txt

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




ANSWER 3

Score 28


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




ANSWER 4

Score 6


bzip2 -dc my_file.tar.bz2 | tar xvf -

worked for me on cygwin