[plug] Recursive Copying of Folder Contents

Gregory Orange gregory.orange at rpsmetocean.com
Thu Jun 4 11:26:59 WST 2009


Andrew Furey wrote:
> On 04/06/2009, Jason Posavec <jasonposavec at iinet.net.au> wrote:
>>> $ cp Music/*/*/*  common-folder /
>>  That would only copy files, and not folders? If so, it proves that the best
>> solutions are always the simplest and most elegant. At first glance, that
>> command looks like it would copy *everything* in the 3 folders under Music,
>> not just the files.
> 
> Actually it'll copy everything in the-3-folders-under-Music, not the
> ones in the levels above. You're thinking of:
> 
> $ cp Music/* Music/*/* Music/*/*/* common-folder
> 
> Andrew
> 

The find a la BillK will work elegantly, rather than munging together 
args to cp that might miss some. It might not be super high performance, 
and I've heard xargs can help there. I wouldn't bother though, clock 
cycles are cheap (:
g



More information about the plug mailing list