How to compare two folders on a Mac

Finder can’t compare two folders, but Terminal can. Run diff -rq FolderA FolderB: it lists every file that is only in one folder (“Only in …”) and every file that exists in both but differs (“Files … differ”). Add -x .DS_Store to skip Finder’s own files. It won’t tell you which copy is newer; for that, and for a list you can sort and act on, use a compare app.

Updated · commands run on macOS 27.2

Compare two folders in Terminal

diff is built into macOS. With -r it walks into every subfolder, and with -q it only says whether files differ instead of printing the differences line by line.

  1. Open Terminal from Applications › Utilities.
  2. Type diff -rq with a space at the end. Don’t press Return yet.
  3. Drag the first folder from Finder into the Terminal window, then the second one. Terminal types their paths for you.
  4. Press Return. Each line is one difference; no output means the folders match.
diff -rq Photos Backup
Only in Photos: .DS_Store
Only in Photos/2026-03: IMG_0302.HEIC
Files Photos/notes.txt and Backup/notes.txt differ
Only in Backup: old

Reading the output

LineWhat it means
Only in Photos/2026-03: IMG_0302.HEICThe file is in that folder of Photos and missing from Backup.
Files Photos/notes.txt and Backup/notes.txt differBoth folders have the file, but the contents aren’t the same.
Only in Backup: oldA whole folder, old, exists only in Backup. Its contents aren’t listed.
(no output)The two folders have the same files with the same contents.

Skip .DS_Store and other files

Finder leaves a hidden .DS_Store file in folders you open, so two copies of the same photos often “differ” only by that. -x skips a name, and you can repeat it:

diff -rq -x .DS_Store Photos Backup
Only in Photos/2026-03: IMG_0302.HEIC
Files Photos/notes.txt and Backup/notes.txt differ
Only in Backup: old

What diff doesn’t tell you

  • Which copy is newer. “Files … differ” doesn’t say which side changed. You can check each file’s date with stat, one file at a time.
  • Sizes and dates. The output is just names.
  • Speed on big folders. To say whether two files with the same name are the same, diff reads them. On a large photo or video folder that takes a while.
  • What to do next. It only reports. Copying the missing files is a separate job (see sync two folders).

Compare with FolderTwin

FolderTwin shows the same comparison as a list: every file with its status (same, only left, only right, newer left, newer right, conflict), its size and date on each side, and what a sync would do with it. Filter by status, sort the columns, and switch between comparing by size and date (fast, with 2 seconds of slack for FAT and exFAT drives) and by contents with SHA-256 (exact). Comparing never changes anything; files are only copied when you press Sync and approve the preview.

Questions

Can Finder compare two folders?

No. Finder can show the size and item count of each folder (File › Get Info), which tells you that two folders differ, but not which files. For a list of differences you need diff in Terminal or a compare app.

Does diff -rq change anything?

No. It only reads both folders and prints what it finds. Nothing is copied, moved or deleted.

How do I compare a folder on an external drive?

The same way. Drives appear under /Volumes, so the path looks like /Volumes/Backup/Photos. Dragging the folder into Terminal types it for you.

Why does diff say a whole folder is “Only in” one side?

When a folder exists on one side only, diff reports the folder once and doesn’t list what’s inside it.

Sources

  • diff(1) manual page — man diff in Terminal
  • stat(1) manual page — man stat in Terminal

More guides

FolderTwin for Mac

Compare two folders, see every difference, and sync only what you approve. Removed files go to the Trash.

Coming soon to the Mac App Store

macOS 14 Sonoma or later · Apple silicon and Intel