Click to See Complete Forum and Search --> : tar.bz2


verb8m
08-15-2001, 10:49 AM
Hi. I want to know how to decompress specific files or specific directories from tar.bz2 archives. I've been reading documents online but still to no avail, I haven't been able to successfully decompress a specific file or directory. I tried the following:

tar xjf /backup/backup-2001-08-15.tar.bz2 /home/myself/blah-file.txt

but oh well... I wrote a perl script to automatically backup everything in /home, but I can't figure out how to restore. Ahh!

Thanks for any help.

possumpuss
08-15-2001, 10:53 AM
Originally posted by verb8m:
<STRONG>Hi. I want to know how to decompress specific files or specific directories from tar.bz2 archives. I've been reading documents online but still to no avail, I haven't been able to successfully decompress a specific file or directory. I tried the following:

tar xjf /backup/backup-2001-08-15.tar.bz2 /home/myself/blah-file.txt

but oh well... I wrote a perl script to automatically backup everything in /home, but I can't figure out how to restore. Ahh!

Thanks for any help.</STRONG>

on SuSE (and afaik on Redhat, too), you can do


tar xIf xxx.tar.bz2


Debian used another patch afaik, so it should by Y instead of I or sth
similar. The "secure" way, that always works is:


bunzip2 -c xxx.tar.b2 | tar xf -

ronmon
08-15-2001, 05:31 PM
The old way:
tar xvfI filename.tar.bz2 (upper case I, (eye))

The next oldest way:
tar xvfy filename.tar.bz2 (works with Slack)

The newest way:
tar xvfj filename.tar.bz2