Inspect contents before syncing

Diff two folders on Mac with Terminal

Use macOS Terminal's diff command when you want to read folder contents and list differences without changing either copy. This guide explains the command and its output. If your next step is to update a backup, the FileLever folder-comparison guide shows how to review a sync plan.

FileLever is available now on macOS. Windows and Linux builds of FileLever are planned. Your files stay under your control.

Run a recursive folder diff in Terminal

Open Terminal and replace both example paths below with your own folders. Keep the quotes around each path so spaces work. The -r option includes subfolders; -q reports which files differ without printing their contents.

This command reads the two folders. It does not copy, overwrite, or delete files. A large media archive can take time to read; let both drives remain connected until it finishes.

Read-only comparison — replace these two example paths


            diff -rq "/path/to/Project" "/path/to/Project Backup"
          

Read the result before deciding whether to sync

For a simple example, imagine new.txt exists only in Project, old.txt exists only in Project Backup, and notes.txt has different content in the two folders. Identical files are not listed by this command. Output paths and ordering depend on your folders.

Exit status 0 means no differences were found in the comparison; 1 means differences were found; a value greater than 1 means an error. Read permission and missing-path errors before drawing conclusions. No output is meaningful only when the command finished successfully.

Illustrative diff output and what it tells you
OutputMeaning
Only in /path/to/Project: new.txtThe second folder has no file at this relative path.
Only in /path/to/Project Backup: old.txtThe backup has an extra file; decide whether it belongs there.
Files …/Project/notes.txt and …/Project Backup/notes.txt differThe file contents differ. This does not tell you which copy should win.

Choose content inspection or a reviewed sync plan

For line-by-line differences in one text file, use diff -u with the two file paths. Terminal diff is not a photo-similarity tool, a full metadata/permissions audit, or a backup scheduler. Start with ordinary downloaded files; cloud placeholders and inaccessible paths can prevent a complete comparison.

Use FileLever when the next job is to update a backup: review To Sync, Target Only, and Unchanged groups, then choose copy/update or mirror. These action groups serve a different purpose from Terminal's content differences; do not assume the two tools classify every file identically.

Use a read-only Terminal command to compare file contents recursively.

Understand files found on one side and files with different contents.

Move to a FileLever sync preview only when you want to update a copy.

A deliberate workflow

A clear path from review to action

  1. Step 01

    Choose two readable local folders

    Connect the drives and make cloud files available locally. Use copies of a small sample folder if you are learning the command.

  2. Step 02

    Run diff -rq with quoted paths

    Replace the example paths, keep the quotes, and wait for the recursive content comparison to finish.

  3. Step 03

    Separate differences from errors

    Read Only in and Files differ messages. Resolve access or missing-folder errors before treating the result as a complete comparison.

  4. Step 04

    Inspect the differences or prepare a sync

    Use a text diff for individual edits, or open FileLever for an explicit source-to-target sync preview. Keep either folder untouched if you have not decided which versions should stay.

No installation for a Terminal diff

Use the diff command supplied with macOS to inspect ordinary local files.

Inspection without writes

The shown diff command changes neither folder. It reports differences for you to interpret.

A separate plan for backup updates

FileLever adds a reviewed sync workflow when content inspection alone does not finish the job.

Product walkthrough

Next step: review a sync plan in FileLever

This is a FileLever demonstration, not a Terminal recording. It shows the separate workflow for reviewing proposed sync actions after you have decided which folder should define the current version.

Common questions

Before you start

What command compares two folders recursively on Mac?

Run diff -rq with the two quoted folder paths. It reports files found only on one side and files with different contents, including subfolders, without syncing them.

How do I compare two directories on Mac with Terminal?

Run diff -rq with the two quoted directory paths. It recursively reports files found only on one side and files with different contents without syncing, overwriting, or deleting either directory.

What should I do after diff shows folders are different?

First decide which folder should define the current version. If you need to update a backup, use FileLever to preview missing, changed, and target-only files before choosing copy/update or a deliberate mirror action.

Does diff -rq change or delete my files?

No. The command shown reads and compares files; it does not copy, overwrite, or delete them. A later sync in another tool is a separate action.

See the files first. Decide what happens next.

FileLever is available now on macOS, with Windows and Linux planned.