Mac: Whether you want to sort out duplicates or figure out which folder has certain files and which doesn’t, you can use the diff command in the Terminal to find out fast.
The diff command is traditionally used to look at the difference between text files like this:
You can also compare the contents of two folders by adding -rq:
diff -rq folder-1 folder-2
Once you enter this command — changing folder-1 and folder-2 to the folders you want to compare– the terminal will spit out a list of differences between them. That’s all there is to it! Hit the link below for more on the process. (Similar functionality is available for Linux users.)
Compare two folders’ contents in Terminal [MacWorld]