How it works...

Repeat after me—"locate is simple and needs to be updated, find works when in a bind, but powerful and cryptic and can break things." Let's continue and begin with the explanations:

  1. The first diff command outputs the changes in the simple diff format. However, in the second instance when running the diff command, we use the -urN flag(s). -u stands for unified format, -r stands for recursive, and -N stands for a new file:
$ diff /etc/updatedb.conf ~/updatedb-v2.conf3c3< PRUNEPATHS="/tmp /var/spool /media /home/.ecryptfs /var/lib/schroot"---> PRUNEPATHS="/tmp /var/spool /media /home/.ecryptfs /var/lib/schroot /media /mount"$ diff -urN /etc/updatedb.conf ~/updatedb-v2.conf--- /etc/updatedb.conf 2014-11-18 02:54:29.000000000 ...

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.