Compare Two Folders with diff -rq
Find files that differ or exist in only one of two folders, in one line.
Run diff -rq on both folder paths to get a short list of differing and missing files.
01Command
Command
$ diff -rq ~/Desktop/FolderA ~/Desktop/FolderB02What 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
!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 lineEvidence: 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
Find files larger than 500 MB on Mac
List the biggest files in your home folder that are eating disk space.
Show file extensions for all files on Mac
Make Finder display .pdf, .docx, .png and every other extension at all times.
Find Which Process Has a File or Volume Open with lsof
List every open file descriptor — files, directories, and network sockets — per process.