Frank Brenner Asked: 2011-09-28 13:38:23 +0800 CST2011-09-28 13:38:23 +0800 CST 2011-09-28 13:38:23 +0800 CST Tar: create new archive from filtered archive 772 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! linux unix tar 1 Answers Voted Mark Wagner 2011-09-28T14:19:42+08:002011-09-28T14:19:42+08:00 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.
Almost there. That extracts to the filesystem. Adding
-O
or--to-stdout
to the first tar and removingv
(which would corrupt stdout) andp
(doesn't make sense) should be sufficient.