I'm building a small program to compare file contents of two directories. These directories SHOULD mirror each other but that may not be the case if someone forgot to copy files to the second directory.
So this program will check to see if all of the files were copied from Dir1 to Dir2.
What I'm having a problem with is the speed in which the files are counted. Currently, I'm using
find /Dir1/ -type f \( -name '*.CR2' -o -name '*.NEF' \)
Because it is unknown if the files will be from a Canon or Nikon camera.
In a situation where we have thousands of files to count it takes way too long.
What is the fastest way to accomplish this?