How can I find duplicate files with different names on Linux?

November 16, 2026 2 answers
Asked by 8x!quartzspanner_731

I want to find files with identical contents, even when their filenames differ. What can I use on Linux?

Answers

_j29!parcelacorn.7

You can hash the files and group matching checksums. For example, run find /path/to/search -type f -exec sha256sum {} + | sort | uniq -w64 -D. Replace the path with the directory you want to search.

This prints entries whose SHA-256 hashes match, regardless of filename. Check the files before deleting anything. Matching hashes are a strong indication of identical content, though not a mathematical guarantee. Filenames containing newlines or backslashes can also make the output tricky to interpret.

_d53!hexwinder.2:

What does the plus sign after the braces do?

Reply to this answer
_e31+tagwrench.6

Try fdupes if you would rather use a tool made for this job. Point it at the directory you want to check and review the matches it reports before removing any files.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions