Forum Discussion
Best duplicate file checker for quickly finding duplicates on Windows or Mac?
You can use PowerShell or Command Prompt (CMD) to find duplicate files by comparing file names, sizes, or hashes.
Method 1: Find Duplicates by File Name & Size (Fast but Less Accurate)
Get-ChildItem -Recurse -File | Group-Object Name, Length | Where-Object { $_.Count -gt 1 } | Select-Object -ExpandProperty Group | Format-Table FullNameWhat it does: Lists files with the same name and size in a folder and its subfolders.
Limitation: Different files can have the same name/size, so this isn't foolproof.
Method 2: Find Exact Duplicates Using File Hashes (MD5/SHA1) (Most Accurate)
Get-ChildItem -Recurse -File | Group-Object { (Get-FileHash $_.FullName -Algorithm MD5).Hash } | Where-Object { $_.Count -gt 1 } | ForEach-Object { $_.Group | Select-Object FullName, Hash }What it does:
- Scans all files recursively.
- Computes an MD5 hash (unique fingerprint) for each file.
Groups files with identical hashes (true duplicates).
No duplicate file checker required. It is a bit slower but 100% accurate since even renamed files are detected.
When I try this command prompt I get the following error:
C:\Users\eelus>Get-ChildItem -Recurse -File | Group-Object { (Get-FileHash $_.FullName -Algorithm MD5).Hash } | Where-Object { $_.Count -gt 1 } | ForEach-Object { $_.Group | Select-Object FullName, Hash }
'Get-ChildItem' is not recognized as an internal or external command,
operable program or batch file.
Could you please advise? It would be great to use a command prompt rather than download a program.
- rafenauenJan 29, 2026Copper Contributor
powershell not command prompt