shellspells beta

patch

patch -pnum < patchfile

patch takes a patch file patchfile containing a difference listing produced by the diff program and applies those differences to one or more original files, producing patched versions.

Commonly used by version control systems. Provides a mechanism for applying a list of differences to one file to create another.

Examples

Create a file containing the differences between two file versions.

diff -u dictionary.xml dictionary.xml.new > dictionary.xml.patch

Apply the patch created above

patch < dictionary.xml.patch