Find duplicate files across directories.
Requires CMake, a C11 compiler, and OpenSSL.
mkdir -p build && cd build
cmake ..
makedupfind [OPTIONS] [PATH...]
If no PATH is given, the current directory is used.
| Option | Description |
|---|---|
-d, --by-directory |
Group duplicates by directory pair |
-i, --interactive |
Interactively select files to delete |
-j, --json |
Output results as JSON |
-n, --no-recursive |
Do not recurse into subdirectories |
-h, --help |
Show help message |
-v, --version |
Show version |
Find duplicates in the current directory:
dupfindFind duplicates across multiple directories:
dupfind ~/photos ~/backup/photosGroup duplicates by directory pair:
dupfind -d ~/dataInteractively review and delete duplicates:
dupfind -i ~/dataOutput as JSON:
dupfind -j ~/dataWith -i, dupfind presents each group of duplicates and lets you choose which file to keep. Every deletion requires individual y/n confirmation.
Group 1/3 (SHA-256: abcd1234..., size: 1024 bytes):
[1] /path/to/file1.txt
[2] /path/to/copy/file1.txt
Keep which file? [1-2, s=skip, q=quit]: 1
Delete /path/to/copy/file1.txt? [y/n]: y
Deleted /path/to/copy/file1.txt
With -i -d, you choose which directory's copies to delete:
Directory pair 1/2: photos/ vs backup/ (under /home/user/):
vacation.jpg
portrait.jpg
Delete duplicates from which directory? [1=photos/, 2=backup/, s=skip, q=quit]: 2
Delete /home/user/backup/vacation.jpg? [y/n]: y
Deleted /home/user/backup/vacation.jpg
Delete /home/user/backup/portrait.jpg? [y/n]: y
Deleted /home/user/backup/portrait.jpg
- Walk the file tree with
nftw(symlinks ignored) - Group files by size
- Compute SHA-256 hashes for files with matching sizes
- Report groups with identical hashes
cd build && ctest --output-on-failureMIT