I need to create a new tar archive from the filtered output of the original. I thought something like this might work:
tar xvpf myarchive.tar --exclude=foo* | tar cvpf mynewarchive.tar
but that doesn't.
Any ideas?
Thanks!
I need to create a new tar archive from the filtered output of the original. I thought something like this might work:
tar xvpf myarchive.tar --exclude=foo* | tar cvpf mynewarchive.tar
but that doesn't.
Any ideas?
Thanks!
Almost there. That extracts to the filesystem. Adding -O
or --to-stdout
to the first tar and removing v
(which would corrupt stdout) and p
(doesn't make sense) should be sufficient.