Unix Shell - newbie: 'find' and 'cp' in a single line ?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > October 2006 > newbie: 'find' and 'cp' in a single line ?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author newbie: 'find' and 'cp' in a single line ?
ctobini

2006-10-13, 7:33 am

Hello,

I would like to make a 'find' on a repertory and copy every file like :

find ... | cp - path

or find ... -exec cp {} \;

but I don't find how to do.

Can you help ?

Thanks.

C. Tobini

x.Soumya@gmail.com

2006-10-13, 7:33 am

Is this going to help..

find / -name fileName 2>/dev/null |xargs -i cp {} .

Kenan Kalajdzic

2006-10-13, 7:33 am

ctobini <ctemp2@free.fr> wrote:
> Hello,
>
> I would like to make a 'find' on a repertory and copy every file like :
>
> find ... | cp - path
>
> or find ... -exec cp {} \;


find ... -exec cp {} path \;

--
Kenan Kalajdzic
Glenn Robitaille

2006-10-16, 1:36 am

Kenan Kalajdzic wrote:
> ctobini <ctemp2@free.fr> wrote:
>
> find ... -exec cp {} path \;
>


find ...|cpio -pdm $DESTINATION

--

Glenn Robitaille
glennr@monitorscripts.com
http://www.monitorscripts.com
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com