Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-02-2008, 08:28 PM   #1
Registered: Oct 2003
Location: Sydney, Australia.
Distribution: PCLinuxOS 2010.12, Debian Lenny
Posts: 396

Rep: Reputation: 38
Piping tar bzcat to add a file to a tar.bz2 archive

Not sure if the title is clear what I want.

This is more out of curiosity.

Is it possible to add a file to tar.bz2 archive without first bunzip2ing it to disk ?

If I dont make sense, read on...

I have a store.tar.bz2 archive and want to add a file to it, call it file

I know I can bunzip it to have a tar file, then add the file with the tar -rf command and then bzip2 again, but without extracting to disk, using pipes, is it possible ?

Best I got was:

bzcat store.tar.bz2 | tar r - file | bzip2 - store2.tar.bz2

But that fails

tar: Options `-Aru' are incompatible with `-f -'
Try `tar --help' or `tar --usage' for more information.
bzcat: Can't open input file store.tar.bz2: No such file or directory.
bzip2: Can't open input file store2.tar.bz2: No such file or directory.
No big deal, just curious.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
How to list the files in my tar.bz2 archive ??? merlin23 Linux - Newbie 13 12-14-2004 08:50 AM
Extracting tar.bz2 archive through console grim_chel Linux - Newbie 3 06-28-2004 11:27 AM
Tar gives error when creating a tar file archive davidas Linux - Newbie 10 04-13-2004 12:35 AM
problem unzipping a tar.bz2 file tar: Error is not recov jyome Linux - Software 4 09-04-2003 01:04 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration