Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Try diff -a -q -r dir1 dir2

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

share|improve this answer
    
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 Sep 13 '12 at 10:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.