opendiff

From Mac Guides

Jump to: navigation, search

Image:Tiger_small.jpg

This tip requires
Mac OS X Tiger

opendiff is a Terminal command used to invoke FileMerge for the specified files (or directories) from the command line.

Examples

To display the difference between two files:

 opendiff file1.txt file2.txt

To display the difference between two files, saving the output:

 opendiff file1.txt file2.txt -merge newfile.txt

To display the differences between two entire directories

 opendiff dir1 dir2 

Man Page Excerpt

opendiff is a command line utility that provides a convenient way to launch the FileMerge application from Terminal to graphically compare files or directories. If FileMerge is already running, opendiff will connect to that running instance for the new comparison. opendiff exits immediately after the comparison request has been sent to FileMerge.

See Also