Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Need some Unix find help.

Need some Unix find help.
Thread Tools
AKcrab
Moderator Emeritus
Join Date: Apr 2001
Location: Wasilla, Alaska
Status: Offline
Reply With Quote
Nov 21, 2007, 05:53 PM
 
I have a client with an extremely broken iPhoto library. All attempts at rebuilding the database fail. We would like to somehow extract all photos from the "Originals" folders. This is iPhoto v5, so there are like 40 "originals" folders.

I'm thinking there must be a way to use the 'find' command to locate all .jpg files in 'originals'. Something along the lines of this:
find /Users/francine/Ttest -name *.png -exec cp '{}' /Users/francine/Desktop/screens/ \;
finds all files with the extension ".png" in the folder Ttest and its sub-folders and copies them to the folder "screens"
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Nov 21, 2007, 06:24 PM
 
Something like:

[codex]find "/path/to/iPhoto Library" -path "*/Originals/*" -name "*.jpg"[/codex]

The -exec cp and all that is exactly the same.
( Last edited by Chuckit; Nov 21, 2007 at 08:24 PM. )
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
AKcrab  (op)
Moderator Emeritus
Join Date: Apr 2001
Location: Wasilla, Alaska
Status: Offline
Reply With Quote
Nov 21, 2007, 11:54 PM
 
Worked like a charm. 8K photos recovered.

Thanks Chuckit.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 22, 2007, 02:34 AM
 
If you want the search to include png and gif images too:

Code:
find "/path/to/iPhoto Library" -path "*/Originals/*" -regex ".*?\.(jpg|png|gif)"
ought to work...
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:57 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,