I want to write a shell script that diffs two files, and dump the result into another file.
I find sdiff
to be more intuitive than just diff
. However, sdiff
doesn't print out the line numbers of where the differences are. I also tried vimdiff
, which shows me line numbers, but I'm not sure how to dump the results into a file from a shell script.
So far, this is what I am using:
sdiff -s file1 file2
Is there a way to get side-by-side diffs with line numbers?
There is a very nice tool for this:
meld
To install:
sudo apt-get install meld
You can check differences between two or more files, also between directories.