Patch a file writing the result to a different file

patch

  • Patch a file (or files) with a diff file.
    Note that diff files should be generated by the `diff` command.
    More information: <https://manned.org/patch>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

patch {{path/to/input_file}} -o {{path/to/output_file}} < {{patch.diff}}

click the source code to copy install patch on any operating system with command-not-found.com