Re: Script to delete duplicate files
On Fri, May 19, 2006 at 08:40:33PM -0700, Curtis Vaughan wrote:
> Paul E Condon wrote:
>
> >On Fri, May 19, 2006 at 07:10:41PM -0700, Curtis Vaughan wrote:
> >
> >
> >>Ok, using fdupes -f I have created a file that contains a list of all
> >>duplicate files. So, what command can a run against that file to delete
> >>all the files listed in it?
> >>
> >>Or since I know that fdupes -f works, could I just do something like:
> >>
> >>fdupes -f ./ | rm *
> >>
> >>or would that rm everything?
> >>
> >>
> >>
> >
> >read
> >man fdupes
> >note the -d option
> >
> >
> >
> >
> No actually the -d option is not an option. The reason is is because it
> then asks you after all found duplicates, which of them you wish to
> keep. Well, I have some 5000 duplicates to go through, so it will take
> forever. I would rather think of a way to use the output of fdupes or
> the file I created to delete all the duplicates.
Do you have 5000 duplicates of a single file or 5000 duplicate groups,
i.e. groups of files that are mutually identical? Do you really want to
delete ALL copies of a file for which there are duplicates? I suspect not,
but I really don't know. If you want to keep one representative copy of
each duplicate group (what I suspect you should want), you have to provide
some method of deciding which one of the several copies that fdupes has
found. There is, I think, more to your problem than you realize. But,
I really don't know.
--
Paul E Condon
pecondon@mesanetworks.net
Reply to: