Recursive move / copy / delete ?

How can I move/copy/delete files of type recursively?

Say I have 100 nested folders with JPG's and other files scattered throughout. I want to copy just the JPG's to a new location keeping the same folder structure.

In unix, you can do something like 'cp -r *.jpg <destination>'
Windows is similar, 'xcopy /s *.jpg <destination>'

I guess since it's just the BSD core, the cp command doesn't have the -r feature.

A solution using Terminal or Finder will do!

Thanks!

iMac Mac OS X (10.4.8)

iMac, Mac OS X (10.4.8)

Posted on Jan 25, 2007 3:34 AM

Reply
5 replies

Jan 25, 2007 11:00 AM in response to Coldburn

I decided to fool around with this, here's the command that I got to work:

find /Users/francine/Ttest -name *.png -exec cp '{}' /Users/francine/Desktop/screens/ \;

It copied 55 png files from the folder Ttest and its numerous sub-folders into the folder screens. I was a bit surprised that it took perhaps 5 seconds to do this (I hadn't thought there were all that many png files in the Ttest sub-folders).

BTW, plain old cp did preserve the resources forks too. Guess that really has been fixed.
Francine

User uploaded file
Francine
Schwieder

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Recursive move / copy / delete ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.