Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compare tool with command line for mac

I am looking for command line tool to do diff between two HTML files. I have analysed kdiff3/command line of bbedit but my problem is dont want to open any GUI. I want to write a java program to call command line options of the diff program to compare html files and save result in a different file or probably show in a report file. Any pointers will be very helpful

Thanks Vishal

like image 781
user708910 Avatar asked Oct 27 '11 23:10

user708910


People also ask

How do you compare codes on a Mac?

Code Compare is not available for Mac but there are plenty of alternatives that runs on macOS with similar functionality. The best Mac alternative is Meld, which is both free and Open Source.

Can you use command-line on a Mac?

You can use the command-line environment interactively by typing a command and waiting for a result, or you can use the shell to compose scripts that run without direct interaction.


1 Answers

If you have xcode installed, you can call up opendiff, it's a (graphical) compare tool from the command line. From it's man page:

opendiff file1 file2 [-ancestor ancestorFile] [-merge mergeFile]
opendiff dir1 dir2 [-ancestor ancestorDirectory] [-merge mergeDirectory]
like image 130
drevicko Avatar answered Oct 09 '22 04:10

drevicko