I'm looking for a way to update thousands of .tbz archive files, so I'll be doing this with a shell script. I need to add one file to each.
My question is, is there a faster way to do this without extracting each tbz's contents, then re-compressing with the new file included in the contained tar? What would the commands look like?
Thanks
Best Answer
While
tar
can add files to an already existing archive, it cannot be compressed. You will have tobunzip2
the compressed archive, leaving a standard tarball. You can then usetar
's ability to add files to an existing archive, and then recompress withbzip2
.From the manual: