recursive file/directory verification on linux

Posted on

Problem :

What would be a command structure or simple bash script to run to compare all files in one directory with all files in another directory, verifying their data are identical, or not, down to the bit? Needs to be recursive so it also verifies files in subdirectories.

Basically a way to ascertain with confidence that a directory copy or mirror operation has maintained data integrity.

Solution :

Try diff -a -q -r dir1 dir2

See for more.