Skip to main content
Corrected into slightly better English trying to stay close to the original. The answer is IMHO useful. Edited again to put the code into the appropriate format.
Source Link

Always do diff -rupP file1.txt file2.txt > result.patch WhenI suggest to use:

diff -rupP file1.txt file2.txt > result.patch

Then, when you will seeread vi result.patchresult.patch, you will instantly know what is exactlythe difference.

Only diff is make very difficult to understand.These are the meanings of the command line switches:

-r: recursivelyrecursive

-u: shows line number

-p(small): shows differencedifferences in C functionfunctions

-P(capital): ifin case of multiple files then showing completethe full path is shown

Always do diff -rupP file1.txt file2.txt > result.patch When you will see vi result.patch, you know what is exactly difference.

Only diff is make very difficult to understand.

r: recursively

u: shows line number

p(small): shows difference in C function

P(capital): if multiple files then showing complete path

I suggest to use:

diff -rupP file1.txt file2.txt > result.patch

Then, when you read result.patch, you will instantly know the difference.

These are the meanings of the command line switches:

-r: recursive

-u: shows line number

-p(small): shows differences in C functions

-P(capital): in case of multiple files the full path is shown

Source Link
Ravi
  • 79
  • 1
  • 5

Always do diff -rupP file1.txt file2.txt > result.patch When you will see vi result.patch, you know what is exactly difference.

Only diff is make very difficult to understand.

r: recursively

u: shows line number

p(small): shows difference in C function

P(capital): if multiple files then showing complete path