[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Recursive copies of selected files



On Thu, Sep 16, 2004 at 06:09:22PM -0700, Stefan O'Rear wrote:
> > I needed to copy a bunch of files from a directory tree -- but only
> > selected files (say all regular files that end in .foo).  I want the
> > destination tree to be created.  find(1) is what I find most useful
> > for specifying what files to match the files I want to move -- but I
> > can't seem to get a good xargs command to get the files in the
> > destination (ie create the dir if doesn't exist and copy the file).

> It seems the "standard" way to do this is tar in a pipe.
> 
> find . | tar -F. -c -f- | (cd ../new && tar -xf -)

I think you want -T not -F:

  find -name \*.foo | tar -T- -cf- | (cd newdir && tar -xf-)


-- 
Bill Moseley
moseley@hank.org



Reply to: