IOS – Compare content of two folders, including subfolders

foldersiosmacosphotos

Over the years I have imported photos from iPhone to Mac and organized them in folder by month.

I now want to import all photos I have on the iPhone and compare those with the files that I've organized in folders over the years – if there are any missing.

Is there any tool (included in OSX or free/purchaseable) or other procedure that can compare folder content, with one folder holding the files in root and the other in many subfolders?

Best Answer

Terminal: diff

You can compare two folders in Terminal using the following command:

diff -rq /path/to/folder1 /path/to/folder2

To ignore folder hierarchy you can copy all the files out of a folder into a third folder, then compare these:

find /path/to/folder2 -mindepth 2 -type f -print -exec cp {} /path/to/folder3 \;