[Ilugc] .a-tip-a-day (diff - differences between text files line by line)

  • From: kapil@xxxxxxxxxxx (Kapil Hari Paranjape)
  • Date: Tue Sep 29 06:53:00 2009

Hello,

On Tue, 29 Sep 2009, Girish Venkatachalam wrote:

$ diff file.txt file-modified.txt

Generally, one should prefer the command
 $ diff -u file.txt file-modified.txt

The reason is that this maintains the _context_ information of the
differences as a result:
 - the diff is more human readable
 - the diff is longer :-(
 - the diff can work with patch even when some unrelated changes
   have been made to file.txt after the diff was created

Regards,

Kapil.
--

Other related posts: