How to do it...

  1. Open a terminal, and run the following commands in order to understand the diff command:
$ diff /etc/updatedb.conf ~/updatedb-v2.conf$ diff -urN /etc/updatedb.conf ~/updatedb-v2.conf
  1. At this point, only the diff information has been output to the console's standard out and a patch file has not been created. To create the actual patch file, execute the following command:
$ diff -urN /etc/updatedb.conf ~/updatedb-v2.conf > 001-myfirst-patch-for-updatedb.patch
Patches can be found in many forms, but they usually have the .patch extension and are preceded by a number and a human readable name.
  1. Now, before applying a patch, it can also be tested to ensure that the results are as expected. Try the following commands:
$ echo ...

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.