Python Prompts Free Prompt

Python Script to Detect Duplicate Files

Write a Python script to find duplicate files in a directory
☆ Save
Prompt
You are a Python developer. Write a script that scans a directory and finds duplicate files based on content (using hashes). The script must: 1) Accept directory path, 2) Recursively scan all files, 3) Compute MD5 or SHA256 hash for each file, 4) Group duplicates, 5) Report duplicates with sizes and paths, 6) Provide option to delete duplicates (keep first), 7) Log actions, 8) Handle large files efficiently (read in chunks). Add comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.