How to remove a file from a tar archive 

Newsgroups: comp.unix.questions
>remove. How do you remove an entry in a tar file? Thanks.

If you have GNU tar:

$ tar --help | grep -i delete
      --delete            delete from the archive (not on mag tapes!)
$ info --index-search delete tar
[snip]

If you're an emacs fan, another option is to use the "tar-mode" of emacs.

And if all else fails, there's always:

mkdir tmp$$; cd tmp$$
tar xf ../tarfile; rm badfile; tar cf ../tarfile .
cd ..; rm -rf tmp$$

Ken Pizzini

documented on: 2000.05.27 Sat 15:06:18