LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 06-02-2008, 09:28 PM   #1
DaveQB
Member
 
Registered: Oct 2003
Location: Sydney, Australia.
Distribution: PCLinuxOS 2010.12, Debian Lenny
Posts: 387

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:

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

But that fails

Code:
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.
 
  


Reply


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 03:53 AM
How to list the files in my tar.bz2 archive ??? merlin23 Linux - Newbie 13 12-14-2004 09:50 AM
Extracting tar.bz2 archive through console grim_chel Linux - Newbie 3 06-28-2004 12:27 PM
Tar gives error when creating a tar file archive davidas Linux - Newbie 10 04-13-2004 01:35 AM
problem unzipping a tar.bz2 file tar: Error is not recov jyome Linux - Software 4 09-04-2003 02:04 PM


All times are GMT -5. The time now is 12:04 AM.

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