I have two files (in a project’s source code base) which I often want to compare visually in FileMerge, as part of a regular routine. I’m trying to script that routine for efficiency, but am stuck on automating this step. Is there a single shell command which will open two files for comparison in FileMerge?

I tried open file1.txt -a FileMerge as a starting point, but this fails with an error message:

[…] FileMerge cannot open files in the “text” format.

1 Answer 1


To call FileMerge from the commandline, use opendiff:

opendiff file1.txt file2.txt

This will open Filemerge with the two files open and diff'd.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .