Skip to main content

Some find commands - useful for copying iCloud Photos to another service.

I've found these commands really helpful when navigating an iCloud Photo library on a Mac.

The native Photos Application on MacOS prohibits a lot of bulk file activity.  These commands should be run from Terminal.

Before starting, it's best to place yourself in the following directory

"/Users/**your username**/Pictures/Photos Library.photoslibrary"

This command is best executed from the "Masters" directory 

find . -iname  *.cr2  -exec ls -lh {} \;

It finds all CR2 files and reports the file sizes  

You could change the ls to a copy, say to copy the image to another folder, like another cloud drive. 


Find all file types outside a defined list, and filter those only in the Masters directory

find . -iname *.* | grep Masters | grep -v -i -E '\.jpg|\.jpeg|\.heic|\.png|\.cr2|\.gif|\.mp4' 



Find all file types IN a defined list, and filter those only in the Masters directory

find . -iname *.* | grep Masters | grep -i -E '\.jpg|\.jpeg|\.heic'



Count all jpg files 

find . -iname *.* | grep Masters | grep -i -E '\.jpg|\.jpeg' | wc -l

Note that counts could be one higher, best to check.   wc -l may also count the first . line 




Comments

Popular posts from this blog

Javascript Form Validation

It's real simple. All you need to do is call a javascript function in a html  " onsubmit " in the form tag as a javascript return, like this       <form method="post" action="dosomething.php" onsubmit="return validateForm();"> If the code completes ok, the form is then sent to the page listed in "action" http://www.w3schools.com/js/js_form_validation.asp If the function specified in the onsubmit returns false, then the form is not sent to the page mentioned in action.