recursive file/directory verification on linux

5

2

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.

DaveO

Posted 2012-09-13T04:35:21.593

Reputation: 163

Answers

4

Try diff -a -q -r dir1 dir2

See http://linux.die.net/man/1/diff for more.

Karan

Posted 2012-09-13T04:35:21.593

Reputation: 51 857

great thanks. I ended up using diff -s -r -q dir1 dir 2 to get a log of identical files as well (to watch progress) – DaveO – 2012-09-13T10:52:43.917