A terminal user interface (TUI) application for finding and managing duplicate files using fdupes.
Priority-based deduplication: You decide which folders have priority. Duplicates are moved FROM target folders while files in non-target folders are always kept. This gives you full control over which copies to preserve.
Safe by design: This application never deletes files. Duplicates are moved to a timestamped folder (__dup_YYYYMMDD_HHMMSS), preserving the original directory structure. You can review the moved files and delete them manually when you're confident they're no longer needed.
- Two-panel folder selection: Select folders to scan and mark target folders for deduplication
- Smart duplicate handling: Files in target folders are moved, files in other folders are kept
- Preview before action: See exactly which files will be moved and which will be kept
- Real-time progress tracking: See percentage and elapsed time during scan
- Save/load configurations: Save folder selections for repeated use
- Internal duplicates option: Optionally handle duplicates within target folders only
- Python 3.10+
- fdupes (must be installed on your system)
- Linux (tested on Ubuntu/Debian)
# Debian/Ubuntu
sudo apt install fdupes
# Fedora
sudo dnf install fdupes
# Arch Linux
sudo pacman -S fdupesgit clone https://github.com/elmisi/american-dedup.git
cd american-dedup
./install.shThis creates a virtual environment and installs the command american-dedup to ~/.local/bin/.
pip install american-dedupamerican-dedup [starting_path]- Add folders to scan: Click "+ Add" to select folders containing files to check for duplicates
- Mark target folders: Check the boxes next to folders from which duplicates should be moved
- Configure options: Optionally enable "Include duplicates within target folders"
- Scan: Click "Scan" to run fdupes and analyze duplicates
- Preview: Review the files that will be moved vs kept
- Execute: Click "Execute Move" to move duplicates to a timestamped folder
q- Quit the applicationF1- Open help screenEscape- Go back to previous screen- Arrow keys - Navigate tree in preview screen
The application uses a priority system:
- Files in non-target folders have high priority (they are KEPT)
- Files in target folders have low priority (they are MOVED)
When a duplicate group contains files from both:
- All copies in target folders are moved
- All copies in non-target folders are kept
When duplicates exist only within target folders:
- If "Include internal duplicates" is OFF: nothing is moved
- If "Include internal duplicates" is ON: first copy is kept, others are moved
Moved files are placed in a __dup_YYYYMMDD_HHMMSS folder, preserving the original folder structure.
If you need to restore moved files, they are preserved in the timestamped folder with the original directory structure intact:
- Navigate to the
__dup_YYYYMMDD_HHMMSSfolder - Browse the preserved directory structure
- Copy or move files back to their original locations as needed
This manual approach gives you full control over what to restore and when.
Configurations are saved to ~/.config/american-dedup/saved_configs.json
Detailed logs are written to /tmp/american-dedup.log for debugging.
./uninstall.shOr if installed via pip:
pip uninstall american-dedupAfter UI changes, regenerate the documentation screenshots:
.venv/bin/python scripts/take_screenshots.pyScreenshots are saved as SVG files in the screenshots/ directory.
MIT License - see LICENSE for details.