Command-Line Interface (CLI) Documentation

This page documents the available commands and options for the Dup File Finder CLI, as implemented in dup_file_finder/cli.py.


Usage

dupFileFinder [--db PATH] <command> [options]
  • --db PATH Path to the database file (default: deduper.db).

Commands

scan

Scan a directory for files and add them to the database.

Usage:

dupFileFinder scan [directory] [--no-recursive]
  • directory (required): Directory to scan.
  • --no-recursive: Don't scan subdirectories (default is recursive).

find

Find duplicate files in the database.

Usage:

dupFileFinder find [--show-all]
  • --show-all: Show all duplicate files (default shows summary only).

delete

Delete duplicate files, keeping only one file per group.

Usage:

dupFileFinder delete [--keep-first|--keep-last] [--dry-run|--confirm]
  • --keep-first: Keep the first file alphabetically (default).
  • --keep-last: Keep the last file alphabetically.
  • --dry-run: Show what would be deleted without actually deleting (default).
  • --confirm: Actually delete files (disables dry-run).

Safety: By default, this command runs in dry-run mode. Use --confirm to actually delete files. You will be prompted for confirmation.


stats

Show statistics about the files in the database.

Usage:

dupFileFinder stats [--by-extension]
  • --by-extension: Show statistics grouped by file extension.

clear

Clear all data from the database.

Usage:

dupFileFinder clear [--confirm]
  • --confirm: Confirm database clearing (required to proceed).

Examples

Scan a directory recursively:

dupFileFinder scan ~/Downloads

Find duplicate files (summary):

dupFileFinder find

Show all duplicate files:

dupFileFinder find --show-all

Delete duplicates (dry run):

dupFileFinder delete

Delete duplicates (actually delete, keep last file):

dupFileFinder delete --keep-last --confirm

Show statistics by extension:

dupFileFinder stats --by-extension

Clear the database:

dupFileFinder clear --confirm

Help

For help on any command, use:

dupFileFinder --help
dupFileFinder <command> --help