1

I need a command line tool to remove duplicate files.

There are several. But I could not find one which always keeps the older files and deletes the newer versions.

I tried finddup, duff, fdupes. Maybe I was blind, but AFAIK there was not way to tell the tools to keep the older file.

guettli
  • 1,765

1 Answers1

2

Probably too late for the O.P. but maybe useful to others:

rmlint --rank-by m [paths]

... will search in [paths] for duplicate files and create a shell script (rmlint.sh) that you can use to delete the duplicates. The --rank-by m option tells it to keep the file with the oldest mtime in each set. There are also several other original selection criteria options