Creating a diff of two files and patching

In what case should you know what a diff is? Or a patch? In the Linux world, it is a way to determine the differences between files and also to solve problems at the OS level (especially if you have a broken driver in the Linux kernel). However, for the purposes of a cookbook, diffs and patches useful for a couple of main things:

  • When determining whether a particular script or configuration file has modifications
  • When plotting differences between versions, or migrating data between an old to new script, and so on

So, what is a diff or differential? A diff is the output that describes the differences between two files (file A and file B). The file A is the source, and the B file is the assumed to ...

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.