Fingerprint of a path

I have a code base and something isn’t working in the way it should. I want to find out if the problem is in some corrupt data or if someone’s edited some files here and there. Unfortunately, the path isn’t under any kind of version control, so what do I do?

Well, I can download a fresh copy of the code base and compare, right? Here’s how you can do that.

find ./path -type f -print0 | xargs -0 md5sum > path.md5s;

Do the same to the fresh installation and diff the outputs. That should give you a reasonable feel for what’s changed, yeah? I don’t know if this is the best approach, so if you know a better way, please tell me.

Update: Seems that diff -urN path1 path2 will do it one better and show the contents of what changed. It doesn’t have the same power of pruning subdirectories that you’d expect from find, but in most cases it’s strictly better.

Leave a Reply