Skip to main content
I highlight this is a most portable solution. I added examples of other useful command options. I added an example to avoid a common unuseful output.
Source Link

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 (iei.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

If you don't mind using the terminal, the diff command can compare directories:

diff -rq directory1/ directory2/

-r indicates recurse through subdirectories, and -q gives brief output (ie don't show the actual diffs, just note what files/dirs are different).

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
Source Link
Adam Parkin
  • 1.6k
  • 1
  • 10
  • 10

If you don't mind using the terminal, the diff command can compare directories:

diff -rq directory1/ directory2/

-r indicates recurse through subdirectories, and -q gives brief output (ie don't show the actual diffs, just note what files/dirs are different).