Patch Some Code – Linux Tip

As you use a Linux computer you will run into a time or two where you will need to build a program from it’s source code. Sometimes this code will need to be patched to add some functionality you want, to fix a bug, or even to add in your personal touches. Linux comes with a simple utility called patch that can help you apply patches to some code. To apply a patch from the root directory of a project, you can run

patch -p0 < patchfile

Also if you want to only check how the patch will work you can add the --dry-run option.

Eric Davis