Comments on How to do line-by-line comparison of files in Linux using diff command

In Linux, the diff command can be used to compare two files, but the thing is that there's a slight learning curve involved with this utility. If you don't know how diff works, and are looking for quick tutorial to get started, look no further, as in this article, we will discuss the basics of this command along with some easy to understand examples.

3 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Pete

diff has a place. Mainly for use in scripts.

sdiff is good for humans on a server. side-by-side diff.

$ sdiff file1 file2 | less

For GUI users, check out meld. It is like tkdiff in the old days, without all the dependencies.

By: Herbert Meyer

Discussing diff without mentioning its evil twin, patch, ignores why the output of diff is so simplistic and cryptic.

By: PJ

I know that diff has its uses but for eyeballing changes to a config file during an installation I think it compares poorly with with something that gives a side-by-side view of differences. I normally use Beyond Compare from Scootersoftware.com (has a linux version) that is probably my nr 1 utility. Meld I'd come across but somehow I missed sdiff. Article worth reading for that comment!