Patching a program

Sometimes it is better to just send the changes to a program to the recipients rather than making a new version for full download especially if the changes are small and the package is big. Patching could help in such instances.

Create a difference file

First step is to create a file that contains the changes to any file in the program, this can be done with the help of diff program,

diff -u /path/to/old/folder/ modifiedfolder > patchfile

Patch up the old program

Now since the patch file is ready , we can patch up the old program with the modifications by entering the program folder and typing

patch < patchfile