Name
patch
Synopsis
patch [options] [original[patchfile]]
Apply the patches specified in
patchfile to original.
Replace the original with the new, patched version; move the
original to original .orig or
original~. The patch file is a
difference listing produced by the diff command. On Solaris, this command
is named gpatch.
Options
-b,--backupBack up the original file.
--backup-if-mismatch,--no-backup-if-mismatchWhen not backing up all original files, these options control whether a backup should be made when a patch does not match the original file. The default is to make backups unless
--posixis specified.-
--binary Read and write files as binary. Has no effect on a Unix system.
-Bprefix,--prefix=prefixPrepend prefix to the backup filename.
-c,--contextInterpret patchfile as a context diff.
-ddir,--directory=dircd to directory before beginning patch operations.
-
--dry-run Print the results of applying a patch, but don’t change any files.
-Dstring,--ifdef=stringMark all changes with:
#ifdef string
...
#endif-e,--edTreat the contents of patchfile as ed commands.
-E,--remove-empty-filesIf patch creates any empty files, delete them.
-f,--forceForce all changes, even those that look incorrect. Skip patches if the original file does not exist; force patches for files with the wrong version specified; assume patches are never reversed.
-Fnum,--fuzz=numSpecify the maximum number of lines that may be ignored (fuzzed over) when deciding where to install ...