mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-10 01:46:39 +00:00
Update cheatsheets
This commit is contained in:
30
patch
Normal file
30
patch
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# 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>.
|
||||
|
||||
- Apply a patch using a diff file (filenames must be included in the diff file):
|
||||
|
||||
`patch < {{patch.diff}}`
|
||||
|
||||
- Apply a patch to a specific file:
|
||||
|
||||
`patch {{path/to/file}} < {{patch.diff}}`
|
||||
|
||||
- Patch a file writing the result to a different file:
|
||||
|
||||
`patch {{path/to/input_file}} -o {{path/to/output_file}} < {{patch.diff}}`
|
||||
|
||||
- Apply a patch to the current directory:
|
||||
|
||||
`patch -p1 < {{patch.diff}}`
|
||||
|
||||
- Apply the reverse of a patch:
|
||||
|
||||
`patch -R < {{patch.diff}}`
|
||||
Reference in New Issue
Block a user