Apple - What directory comparison tools can I use on OS X?
FileMerge (free), shipped with Xcode, offers a directory view.
A command line version is available through the Terminal application opendiff.
Here's how you can compare two directories with FileMerge:
- ⌘+space, type in "FileMerge" and open it.
- Click the "left" button and choose the folder you would like to move items FROM. (The "old" folder)
- Click the "right" button and choose the folder you would like to move items TO. ("new" folder) and click "Compare" button
- In the right panel, choose to exclude: "identical" and "Changed right". This way you will only see files which are missing in the "new" folder and ignore files your may have added in the "new" folder.
- Move files manually in Finder or let FileMerge do it, by choosing an option in the "Merge" dropdown in the right panel.
Built-in utility for macOS and Linux
If you don't mind using the terminal, the diff
command can compare directories.
This utility is also available in most Linux distributions.
diff -rq directory1/ directory2/
-r
indicates recurse through subdirectories, and -q
gives brief output (i.e. don't show the actual diffs, just note what files/dirs are different).
Other useful options are:
-s
report identical files,
-i
ignore case in file contents,
--ignore-file-name-case
ignore case when comparing file names.
If you want to avoid warnings (mostly usefulness warnings) about differences in the .DS_Store
files, then use:
diff -rq directory1/ directory2/ | grep -v .DS_Store
Diffmerge should meet all your requirements.