How best to compare huge directory trees

you can just use in the terminal

du -a

This will return all the files in all sub folder including there sizes, then just compare the files

To save the data to a text file

du -a > dump.txt

Then you can just use something like diff to compare the files

This is for linux :D


I've used MD5 hashes and diff to compare trees in the past. It's slow but will find changed files in cases where the dates are not reliable. It's also portable so you can transfer the index instead of comparing files via the network.

find /path/to/check -type f | xargs md5sum > after.txt

diff before.txt after.txt > diffs.txt

I'll try to expand a bit on how to do it with Total Commander (I hope I understood what you want to do).

  • install DiskDir packer plugin (I put a direct link to plugin, if you prefer you can go to plugins page and look for DiskDir plugin
  • after the plugin is installed "pack" the directory you want to track changes of with Alt+F5 and select "lst" from the drop down list in Packer part of the dialog box; this will create a "package" that you can enter by pressing enter, like you would enter a directory and it will show complete contents of the directory
  • when comparing results go to the original directory on the left pane and enter desired snapshot on right pane
  • use "Synchronize Dirs" function, located in Commands menu
  • in Synchronize directories window uncheck compare by contents, check Subdirs and Ignore date (or not if changed date is important) and run comparison
  • window will show you files that are equal (in this case not by contents, only by size), files that are different and files missing on left/right side

Since the snapshot is a plain text file and you are not comparing by contents it should be fast but I never used it for a really huge directory.

This is useful if you are not making backups but only wish to make a snapshot of what contents of the directory was at some point. If you do make backups you can use same tool (Synchronize dirs) to also compare by contents.

There is also an extended version of DiskDir plugin, download link is in the first post. This version enables you to have packages (like zip, 7z...) show as directories in the snapshot. This would of course increase time to make a snapshot.