Compare Two Folders with diff -rq

Find files that differ or exist in only one of two folders, in one line.

macOSdiffFilesLow risk
Run diff -rq on both folder paths to get a short list of differing and missing files.

01Command

Command
$ diff -rq ~/Desktop/FolderA ~/Desktop/FolderB

02What it does

Each result line says "Files … differ", "Only in FolderA", or "Only in FolderB", so a long folder tree collapses to a handful of lines. Drop -q to also see the actual content changes with a normal diff. Add -x pattern to skip files like .DS_Store, and -u for a friendlier patch-style output when comparing text.

03Risk

RiskLow risk
!Warning: Binary files are only reported as "differ" — diff cannot show what changed inside them.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • diff – Compare files line by line
    ss64.com · technical · 2026-09-17
    Evidence: diff -r recurses through directories; -q reports only which files differ or are unique to one side.

Last verified: 2026-09-18 · Category: Files & Folders

06Related solutions