[X4U] command line cp question
David Ledger
dledger at ivdcs.demon.co.uk
Thu Dec 1 22:41:57 PST 2005
>From: Stroller <macmonster at myrealbox.com>
>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 \;
>
>If you have multiple files with the same_name.pl but in different
>directories then you'll need to use something different.
You'll also need a -prune for .../backupdir
I'll produce an example later if no-one else does.
David
--
David Ledger - Freelance Unix Sysadmin in the UK.
Chair of HPUX SysAdmin SIG of hpUG technical user group (www.hpug.org.uk)
david.ledger at ivdcs.co.uk
www.ivdcs.co.uk
More information about the X4U
mailing list