6

I'm looking for a command line tool for windows that will go over a directory tree (recursively) and output a list of all the files in there, and a checksum for each file (can be CRC, MD5, whatever).

Esentially, what I want is to compare 2 big directory trees in 2 machines. I'm planning to take the outputs of running this tool in both, and diffing them to make sure they're identical.

I appreciate any ideas.

Daniel Magliola
  • 1,129
  • 5
  • 20
  • 25

4 Answers4

6

hashutils and HashCheck are the best packages I've found on Windows so far. Both tools are open source from the same author, but HashCheck is a shell extension and hashutils is a set of CLI tools. In my testing, they're significantly faster than the ported unxutils versions. (Despite the expectation that they'd be I/O bound.)

I also think that these tools are better than the often-mentioned HashTab, and if I could get to the Ars OpenForum, I'd link a post I wrote up with my justification.

afrazier
  • 22,987
  • 3
  • 60
  • 88
  • Ah, I can get to Ars again. [Comparison of HashCheck & HashTab](http://arstechnica.com/civis/viewtopic.php?f=15&t=33861&p=891309) – afrazier May 03 '10 at 14:31
  • Hashutils did the trick. EXACTLY what I needed. Thanks! – Daniel Magliola May 03 '10 at 14:40
  • +1 on answer. Nice - for me I would store the output report and then use something like beyond compare comparison tool to compare the current report with the older ones to see what's changed - sound plausible? – therobyouknow Jun 20 '13 at 12:44
  • @therobyouknow: Yes, you can do that. I've done it as a fast way of finding different files on systems where running Beyond Compare on both datasets at once was difficult or impossible. It's much easier to FTP/copy/email a small txt file around to check against. – afrazier Jun 20 '13 at 13:00
1

Easy in the *nix world. Just grab the tools and then make a pipeline of find, sort, and md5sum.

find . -type f -print0 | sort -z | xargs -0 md5sum
Ignacio Vazquez-Abrams
  • 111,361
  • 10
  • 201
  • 247
  • 3
    Any ideas for the *indows world? – Daniel Magliola May 03 '10 at 13:41
  • 2
    Did you try the link? – Ignacio Vazquez-Abrams May 03 '10 at 13:55
  • The link in IVA's answer is to Windows ported versions of the needed GNU tools. Another option would be cygwin to add a full Linux-a-like environment to Windows, though that would probably be overkill for what you describe soI suggest you give unixtools a go. – David Spillett May 03 '10 at 14:11
  • Sorry, no, I didn't follow the link, the start of your comment seemed like the typical "windows sucks" snide remark, I didn't even see the link :-) Thank you for the tip! – Daniel Magliola May 03 '10 at 14:37
  • you should be able to use @IgnacioVazquez-Abrams 's answer in mobaxterm. This is free, self-contained single .exe program that provides a Linux-like command line shell on top of Windows - which is what CygWin does too. In fact Mobaxterm is based on Cygwin I believe, but far less messy in terms of setting up, dependencies etc. It really is just download and run. – therobyouknow Jun 20 '13 at 12:43
0

Total Commander (File -> Calculate checksums). But beware! If all filenames belong to your locale codepage, encoding will be this codepage, otherwise UTF8.

Smit Johnth
  • 601
  • 7
  • 15
-1

Disclaimer: I am the author of this library.

An alternative is pyFileFixity, a self-contained Python 2 library, containing the tool "rfigc.py". It works on Windows (since my machine runs Windows 7 x64) but it should work on all platforms, and the databases generated on one OS can be used on other OSes (because paths are relative and always uniformized in UNIX style).

gaborous
  • 1,853
  • 1
  • 18
  • 15