diff Notes

2016-11-15 Tue

Recursive diff

While changing my static site compilation code, I wanted to verify that the generated results hadn't been modified accidentally. This included directory structure, filenames, and file contents. This did the job.

$ tree
.
├── new
│   ├── bar.txt
│   └── foo.txt
└── old
    ├── bar.txt				# Modified in new/
    ├── baz.txt				# DNE in new/
    └── foo.txt

$ diff -r old new
diff -r old/bar.txt new/bar.txt
6c6
< if x = 0:
---
> if x == 0:
8d7
< 
Only in old: baz.txt

$ diff -qr old new			# -q, --brief
Files old/bar.txt and new/bar.txt differ
Only in old: baz.txt