1

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!

Frank Brenner
  • 321
  • 1
  • 4
  • 9

1 Answers1

1

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.

Mark Wagner
  • 18,019
  • 2
  • 32
  • 47