[X4U] command line cp question

John Baltutis baltwo at san.rr.com
Fri Dec 2 11:35:19 PST 2005


On 12/02/05, Kansas Territory <kansast at mac.com> wrote:
> On Dec 1, 2005, at 9:38 PM, Stroller wrote:
>> On Dec 1, 2005, at 9:28 pm, Kansas Territory wrote:
>>> Could someone give me a hint or a clue as to how I could on a
>>> server, via the command line..
>>> COPY all files that end in .pl   into a directory.
>>>
>>> I know if I'm in one directory.. I could do something like
>>>
>>> cp *.pl  backupdirectory
>>>
>>> But I want to start up on the root level  /      and copy ALL
>>> files on the server than end in .pl
>>
>>    find / -name "*.pl" -exec cp \{} backupdir \;
>
> Thanks for the reply.
>
> find / -name "*.pl" -exec cp \{} perlscripts/
>
> i tried running this from the command line...  I get:
>
> find: missing argument to `-exec'
>
> I'm trying to run this from a command line.. on  a Linux box if that
> makes any difference ?

You need to include the escape character and the semicolon at the line's end
(and maybe even have to escape the trailing /):

The example was: find / -name "*.pl" -exec cp \{} backupdir \;

Yours: find / -name "*.pl" -exec cp \{} perlscripts/ \:


More information about the X4U mailing list