I wrote and used these snippets to compare two root-filesystem backups from a KVM but they could be used for any similar directory hierarchy. The snippets helped me spot deltas between the two hierarchies and confirm the newer backup superseded the older one, so the old copy could be discarded.
This Gist presents a concise yet practical set of shell snippet recipes that help to visually and functionally compare two similar directory hierarchies (trees). For example, comparing two root filesystem backups, but it works for any pair of paths. The gist outlines three main approaches:
- comm → review output via
less -S
. - vimdiff → interactively explore differences.
- rhash → compare checksums for exact binary verification, then view differences with
comm
orvimdiff
.