do you want to cp all the fred*.xml or not copy all the fred*.xml?

find / -name 'fred*.xml' -exec cp {} /home/fred/fredbackup \;

should probably do it if you want the former...

normally I'd do the find and then use piped tars for the copy,

find / -name 'fred*.xml' > fileilist
tar -T filelist -cf - | ( cd /home/fred/fredbackup ; tar -xvf - )

use tar -X to exclude..

Dave.

On Wed, 2 Apr 2003, Stuart Guthrie wrote:

> I'm looking at excluding files from a directory to be copied to another
> disk.
>
> I cannot work out how to pipe the list of files into a cp command.
>
> eg
>
> find / -name 'fred*.xml' | cp - /home/fred/fredbackup
>
> bad example but the gist is the the - is a placeholder for the piped
> list of file names. Is there an easy way to do this with some obscure
> linux/unix syntax {}/\@ perhaps?
>
>
>
> Stu
>
>
>
>

-- 
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / [EMAIL PROTECTED]
pam_smb / Linux DecStation / Linux VAX / ILUG person

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to