compare-dir
Compare two directories and show the differences, or find duplicated files within a single directory.
- For two directories, it compares the file contents if the file sizes are the same. Useful to verify backup copies.
- For a single directory, it cryptographically hashes matching file sizes to discover exact duplicates.
Installation
See Releases for the change history.
Usage
Compare two directories:
Find duplicated files in a single directory:
Please use the -h option to see all options.
Hash Cache
The file hashes are cached in a file named .hash_cache.
If you think file contents may be changed without their last modified time changed, please remove the cache file. The tool will then recompute the hashes.
If one of ancestor directories has the cache file, the nearest one is used instead. You can create an empty file to use as the cache file at the ancestor directory.
For example,
Then ~/data/.hash_cache is used as the cache file
instead of ~/data/subdir/.hash_cache.