Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Find duplicate files on Mac OS X

I am trying to grep duplicate files in this selection:

find . -name '*.CR2'

I want to delete duplicate CR2 on my RAW files archive. How can I grep them maintaining the path? Or is there a better way to remove them?

I'd like to identify them by name and size.

share|improve this question

marked as duplicate by slhck Jan 13 '13 at 21:22

This question was marked as an exact duplicate of an existing question.

I doubt this can be done with grep, but there should be other methods. How exactly do you identify duplicate files? – Dennis Jan 13 '13 at 17:54
Add diff to your toolbox. – Tom Wijsman Jan 13 '13 at 17:57
I want to identify them by name and eventually by size! – TechnoPhil Jan 13 '13 at 18:10
Excuse me guys for my bad english! I can't use "fdupes" because i am using Mac OS! Thanks for support! – TechnoPhil Jan 13 '13 at 21:00
I just found another question dealing with the exact same problem, see: Find duplicate files on Mac OS X — the first answer lists a couple of tools you can try, even if you can't install fdupes. (You can install fdupes through Homebrew if you want, but it takes a little to get it set up). If you want to reply to me here, please use @slhck. – slhck Jan 13 '13 at 21:23

What you want to achieve might be a perfect fit for fdupes. From the manpage:

SYNOPSIS fdupes [ options ] DIRECTORY ...

DESCRIPTION Searches the given path for duplicate files. Such files are found by comparing file sizes and MD5 signatures, followed by a byte-by-byte comparison.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .