script to consolidate and clean up media on my computer
# copy all known places where photos exist to input/
# preserve metadata when doing the copy (modification timestamps, etc.)
cp -rp ~/Pictures/* input/
cp -rp ~/Documents/Photos/* input/
# detect and remove duplicate files within input/
npx duplicate-files-fast --directory ./input --extensions jpg,jpeg,JPG,heic,HEIC,mp4,MP4,mov,MOV,png,PNG --remove
# if you want to do a dry run, use this line instead, which prints out files that will be removed
#npx duplicate-files-fast --directory ./input --extensions jpg,jpeg,JPG,heic,HEIC,mp4,MP4,mov,MOV,png,PNG --remove --dryrun
# move all found media files to output directory (/Volumes/photos)
find input -iname \*.jpg -exec cp -p {} /Volumes/photos \;
find input -iname \*.jpeg -exec cp -p {} /Volumes/photos \;
find input -iname \*.JPG -exec cp -p {} /Volumes/photos \;
find input -iname \*.heic -exec cp -p {} /Volumes/photos \;
find input -iname \*.HEIC -exec cp -p {} /Volumes/photos \;
find input -iname \*.png -exec cp -p {} /Volumes/photos \;
find input -iname \*.PNG -exec cp -p {} /Volumes/photos \;
find input -iname \*.mp4 -exec cp -p {} /Volumes/photos \;
find input -iname \*.MP4 -exec cp -p {} /Volumes/photos \;
find input -iname \*.mov -exec cp -p {} /Volumes/photos \;
find input -iname \*.MOV -exec cp -p {} /Volumes/photos \;