A command-line tool to detect and optionally remove duplicate files based on their hash values (MD5 or SHA-256). This tool uses the Crypto++ library for hashing and the C++17 filesystem library for directory traversal.
- MD5 or SHA-256: Choose your hashing algorithm via command-line flags (
-md5
or-sha256
). - Recursive Directory Scan: Traverses all files in the specified directory or directories.
- Dummy Test Mode: Optionally perform a dummy test run without actually deleting any files.
- Manual or Automatic Deletion: Choose whether to keep one file and delete the rest automatically, or manually pick the file you want to keep.
- Logging: Generates a timestamped log file detailing all actions taken.
- Clone this repository: git clone https://github.com//mydupefinder.git
- cd mydupefinder
- g++ -std=c++17 -O2 mydupefinder.cpp -o mydupefinder -lcryptopp
Usage ./mydupefinder [options] [ ...]
Options -md5
Use MD5 hashing algorithm. -sha256
Use SHA-256 hashing algorithm (default). -help or --help
Display usage information. Example
./mydupefinder /path/to/directory
./mydupefinder -md5 /path/to/dir1 /path/to/dir2 /path/to/dir3
./mydupefinder -help After running the tool, you will be prompted to select directories from which duplicates should be removed, choose whether to perform a dummy test, and optionally confirm manual deletions. A log file named log_YYYYMMDDHHMMSS.txt will be created in the current working directory with details of the actions taken.