patch

patch

Purpose

Apply the output of the command to an original file.

Syntax

patch [options] < patch_file

Options

-c causes the patch file to be interpreted as a context

-e forces patch to interpret the patch file as an ed script.

-f forces patch to be applied regardless of any inconsistencies.

-n causes the patch file to be interpreted as a normal

-pn strips everything up to n slashes in the pathname.

-R indicates that patch file has been created with new and old files swapped.

-u causes the patch file to be interpreted as a unified

-v displays the version number.

Description

The patch command is used to update an original file by applying all the differences between the original and a revised version. The differences are in the form of an output from the command, stored in the patch_file. Changes to Linux kernel source code are distributed in the form of a patch file. discusses how to apply patches to the kernel source.