RexCode logo

How to Compare Two Folders on macOS

Folder comparison is the process of identifying which files were added, deleted, or modified between two directories — essential for version control, backup verification, and pre-deployment checks on macOS.

A few situations you probably hit often: confirming a backup drive exactly matches the source folder, checking a site’s build output for unexpected changes before deploying, aligning a project a colleague sent with your own copy, or seeing where two folders differ before cleaning up duplicates. Folder comparison solves all of these.

Here are three methods, from the most visual GUI tool to a built-in Terminal command, with a comparison table at the end to help you choose.


Lode is a native macOS app (Tauri 2 + Rust) that combines folder compare, file diff, full-text search, and hex viewing in a single workbench. Folder Compare is one of its core modes, with a Rust async I/O backend that scans thousands of files near-instantly.

Steps

  1. Download and install Lode
  2. Open Lode and select the Folder Compare mode
  3. Drag the left folder into the left pane, right folder into the right pane
  4. Lode instantly renders a dual-tree view with color coding

Color legend

Color Meaning
🟢 Green Only on the right (added)
🔴 Red Only on the left (deleted)
🟠 Orange Present on both sides, content differs (modified)
⬜ White Identical

Double-click any orange file and Lode switches to File Compare — a side-by-side, line-level diff with changes highlighted. You can also full-text search within the results to jump to a specific filename or content, which is especially useful in large directories.

Tips

From Rex’s experience: I use Lode to compare my _site/ build outputs before each deployment. The dual-tree makes it far easier to catch unexpected changes than scrolling through diff -rq plain text — especially when the goal is finding the two or three changes hidden among hundreds of files, where color coding beats reading a text list.


Method 2: Terminal diff -rq (No Install Required)

macOS ships with diff. The -r (recursive) and -q (only show differing files) flags are all you need:

diff -rq /path/to/folder-A /path/to/folder-B

The output lists three kinds of result: Only in A: (unique to A), Only in B: (unique to B), and Files A/x and B/x differ (present on both but different).

Filter by extension:

diff -rq --include="*.py" /path/to/folder-A /path/to/folder-B

Exclude noise directories:

diff -rq --exclude=.git --exclude=node_modules /path/to/folder-A /path/to/folder-B

Pros: Zero install, scriptable into CI, output can be post-processed with grep / awk. Limitation: Text output only, hard to read at scale, no graphical line-level diff — to see actual content differences you still run diff again on a single file.


Method 3: Xcode FileMerge

If Xcode Command Line Tools are installed, run:

opendiff /path/to/folder-A /path/to/folder-B

This opens Apple’s FileMerge — a basic GUI where you can click into a single file for a side-by-side diff. It’s more bare-bones than Lode (no full-text search, no hex, dated UI), but it’s free and pre-installed on any Mac with the Xcode toolchain, handy for a one-off comparison.

If you don’t have the Command Line Tools yet, run xcode-select --install.


Comparison

Tool Install GUI Live Search Hex Best for
Lode Yes ✅ Dual-tree Daily dev workflow
diff -rq None (built-in) Scripts, CI pipelines
FileMerge Xcode CLT ✅ Basic Occasional use

How to choose? For automation or CI, use diff -rq; for a rare one-off without installing anything, use FileMerge; if you do this daily and often need to inspect content differences or search, Lode is the smoothest experience.


FAQ

Q: Does Lode support Apple Silicon (M1/M2/M3)? A: Yes. Lode ships as a native Apple Silicon binary built with Rust, running natively on M1, M2, and M3 Macs, and cold-starts in under a second.

Q: Will comparing node_modules be slow? A: Terminal diff -rq is slow on massive directories like node_modules. Lode’s Rust backend uses async I/O and is faster, but it’s still best to exclude noise directories like .git and node_modules — the results are easier to read too.

Q: Can I compare just a specific subdirectory? A: Yes. In Lode, each pane can point to a different subdirectory at any depth; in Terminal, just pass the target subdirectory path directly.

Q: Can I compare two external drives or network volumes? A: Yes. As long as the volume is mounted in Finder, all three methods can point to its path (usually under /Volumes/DriveName/). For network volumes, speed depends on bandwidth.

Q: Can I see only the files that differ? A: Yes. diff -rq already lists only differing files; Lode can filter out the “identical” entries to leave just additions, deletions, and modifications.

🔨
The tool featured in this article: Lode

Native macOS workbench — Folder Diff, File Diff, Binary Diff, and full-text Search in one app.