I saw an old topic today, and the older is definitely knowing. I don't want to give a newbie to a newbie;) Use Diff / Patch to patch the code for code 1. DIFF's use of DIFF to complete the comparison function, generate patch file format: : DIFF [option] Oldfile Newfile Common Option option is: -r Recursively processes the directory -U output unified format, DIFF has "traditional" and "unified" format, now generally use "unified" format, comparison The files generated in the unified format are large, but contain more information, which is conducive to reading the binary-n patch containing the binary default in the new file -a patch, and the DIFF is printed to the standard output, so it is generally heavy Direction to the file and suffix with patches, that is, the so-called patch file example: / * Oldfile hello.c * / void main () {Printf ("Hello the world! / N");} / * newfile hello-new. C * / void main () {Printf ("Hello the World! / N");} Generate patch files using the following command Hello.patch $ DIFF -U Hello.c Hello-new.c> Hello.Patch diff Directory compares, generating patch files, such as Hello-1.0 and Hello-1.1 directories, where Hello-1.1 is Hello-1.0 update command: $ diff -Runa Hello-1.0 Hello-1.1> Hello-1.1.Patch 2. Patch's use uses the patch to the original code command to patch patch [-b] suffix