Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rebello95

macrumors member
Original poster
Jun 15, 2011
40
0
USA
Hey I made an application in AppleScript, and copied some files into the contents folder of the application.

I need to know how to have terminal find a file in /appname/Contents/File.zip and copy that to another directory.

PLEASE HELP!
 
Hey I made an application in AppleScript, and copied some files into the contents folder of the application.

I need to know how to have terminal find a file in /appname/Contents/File.zip and copy that to another directory.

PLEASE HELP!

In terminal, do the following:

Code:
cd ~
find . -name "File.zip" -print
CD ~ puts you in your home folder. The find command gives you the path to the files it finds. Now you know where the files are.

You (more or less) could also do the following:

Code:
cd ~
for f in `find . -name "File.zip" -print`; do
cp $f ~/destinationfolder
done

I'm a little rusty on shell script looping syntax and I'm not in front of my Mac so you'll have to do a little trial and error or googling to get the syntax just right.

hope this helps...
 
Code:
cd ~
for f in `find . -name "File.zip" -print`; do
cp $f ~/destinationfolder
done

Or a little more compactly (and little less as though this is a Windows batch script :D)
Code:
find ~ -name File.zip -exec cp "{}" ~/destinationfolder \;


EDIT: Grrrr. This thread turned out to be the same as thread, essentially.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.