diff and patch — comparing and applying changes
cheat sheet · GNU diffutils https://lab.dimsanych.ru/en/wiki/diff-patch/Cheat sheet
-
diff -u a breadable differences -
diff -qr dir1 dir2which files differ -
diff <(cmd1) <(cmd2)compare the output of two commands -
diff -u orig new > p.patchmake a patch -
patch orig < p.patchapply the patch -
patch --dry-run -p1 < git.patchcheck it applies, without writing -
patch -R < p.patchrevert an applied patch -
vimdiff a bside by side
Options
Below are the main flags of diff and patch; the full list is in man diff, man patch.