.bz2 compression


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers .bz2 compression
# 1  
Old 01-18-2005
.bz2 compression

I have heard that bz2 compression a relatively new compression encoding algorithm, far superior to tar and gz. I also remember that I downloaded a FreeBSD LiveCD a while back that was only a couple hundred megs instead of the usual 650ish using bz2 - big difference, I'd say. But to the point, what are the commands to compress/uncompress using bz2 and would I need to download any files to get it to work?

Thanks in advance,
Robert
# 2  
Old 01-18-2005
As you may have guessed, bzip2/bunzip2 can be used for compressing/decompressing bzipped archives. Of course there is bzcat as well.

I usually use one of the two commands to decompress a bzipped archive:

tar xjf something.tar.bz2
bunzip2 something.tar.bz2 | tar xf -

(2nd for non GNU-tar)

Usage is similar to that of gzip. You can search for more examples or read the manpage.

Modern Unix distributions usually have them. If not you may consider to get one from http://sources.redhat.com/bzip2/.
# 3  
Old 01-19-2005
Ah, wonderful! Thank you.
# 4  
Old 01-19-2005
Oh, how would I compress a directory in bz2?

Last edited by Phobos; 01-19-2005 at 12:25 AM..
# 5  
Old 01-19-2005
tar cvjf mydir.tar.bz2 /my/dir/here

Will tar recursively then compress with bzip2 (for GNU tar).

Cheers
ZB
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash not removing all .tar.bz2 files after extracting

In the bash below each .tar.bz2 (usually 2) are extracted and then the original .tar.bz2 is removed. However, only one (presumably the first extracted) is being removed, however both are extracted. I am not sure why this is? Thank you :). tar.bz2 folders in /home/cmccabe/Desktop/NGS/API ... (3 Replies)
Discussion started by: cmccabe
3 Replies

2. Programming

Aria2c to download and extract. tar.bz2

I am using aria2c to download a .tar.bz2 and trying to extract it in the same command. I can download the file but not extract it. I can also manually extract the tar.bz2., but not in the same command. Thank you :). aria2c -x8 -l log.txt -c -d /xx/xx/xxx --use-head=true --http-user "<user>" ... (8 Replies)
Discussion started by: cmccabe
8 Replies

3. HP-UX

Gcc .bz2

Hello, I need to install GCC but the only archive (GCC-4.9.2) for it I can find is a .bz2 format file. Looking at https://www.unix.com/shell-programming-and-scripting/105282-how-unpack-install-tar-bz2-library.html provided some help, but when I use tar in that way I get the following,... (8 Replies)
Discussion started by: YogaBija
8 Replies

4. UNIX and Linux Applications

Download firefox-19.0.2.tar.bz2

Does anyone know a reliable source to download firefox-19.0.2.tar.bz2 from? I would think you be able to download from firefox or mozilla somewhere. I haven't gotten anything useful from my google searches. (2 Replies)
Discussion started by: cokedude
2 Replies

5. Shell Programming and Scripting

Put one tar.bz2 file to another tar.bz2

Hi experts, I have two tar.bz2 file,: a.tar.bz2 and b.tar.bz2 I want to put a.tar.bz2 in to b.tar.bz2 eg: b.tar.bz2 only have one file named "b.c" contained I want it contain "b.c and a.tar.bz2" I don't want to decompress the b.tar.bz2 to achieve this, I try with "cat a.tar.bz2 >>... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

6. UNIX for Dummies Questions & Answers

Unable to extract bz2-00 file

I have a file having name smthing.tar.bz2-00 I am trying to unzip it using tar -xvjf "name" But I am not able to unzip it. PLease advise for the issue. (3 Replies)
Discussion started by: nixhead
3 Replies

7. Shell Programming and Scripting

.bz2 extension file

How to open a .bz2 file in unix. (1 Reply)
Discussion started by: pritish.sas
1 Replies

8. Shell Programming and Scripting

How to unpack and install .tar.bz2 library ?

Hi, I am trying to unpack and install .tar.bz2 library. I was told to cd / and than tar -jxvf /source-of-library-file?...tar.bz2 to get files unpacked and installed into / Darius $ pwd / $ $ tar -jxvf /tmp/local/root/ncurses-dev-addon.tar.bz2 ncurses-dev-addon/... (3 Replies)
Discussion started by: jack2
3 Replies

9. Shell Programming and Scripting

compare two tar.bz2

Hello, I am using a bash script to archive directories of text files located in ${root}: tar cf ${root}.tar ${root}* bzip2 ${root}.tar I'd like to compare the newly produced archive two.tar.bz2 with the second latest one.tar.bz2. cmp one.tar.bz2 two.tar.bz2 returns one.tar.bz2 two.tar.bz2... (2 Replies)
Discussion started by: JCR
2 Replies

10. UNIX for Advanced & Expert Users

extracting from tar.bz2

hi could any body tell me how to extract .tar.bz2 files i tried using tar but in vain. i found bzip2 in googling but i could not find it on machine unix tru64 please suggest. (1 Reply)
Discussion started by: Raom
1 Replies
Login or Register to Ask a Question