fdupes icon indicating copy to clipboard operation
fdupes copied to clipboard

Feature request: rule of selection/decision which file is duplicate

Open nepumuk-fs opened this issue 6 years ago • 2 comments

Normally when getting duplicates on the hard disc, it is clear for the user which of the duplicates is the original file at its desired location and which one is the redundant one. For me, it is still not obvious when fdupes considers a file as duplicate or as original.

Therefore, I suggest the feature for adding a rule (e. g. file location, various attributes, age, date of last modify) to choose which files are supposed to be deleted (or kept).

I also suggest a not-delete-option in case of doubt.

nepumuk-fs avatar Feb 27 '18 11:02 nepumuk-fs

You probably need this option (from man)

-o --order=BY select sort order for output and deleting; by file modification time (BY='time'; default), status change time (BY='ctime'), or filename (BY='name')

But it won't help in all cases. By default results are sorted by modification time.

Suppose you want to find duplicates in two directories: ./a and ./b and you are sure that directory ./a contains originals and ./b may contain duplicates. I suggest to use touch to set modification or status change time in all files inside ./b and you can be sure that file in ./b will always be last of the duplicates, not first.

Or you probably don't need this if first directory is lexicographically before the second one. If not, you can temporary rename it (let's say first is called zzz and second is called yyy, if you call them 000zzz and 001yyy`, the should be sorted correctly).

fancywriter avatar Mar 04 '18 20:03 fancywriter

I'd like to be able to choose which file is deleted by filename length. At present it always seems to be the shorter one which is preserved, but sometimes I want the more descriptive (i.e. the longer) filename to be preserved. Sorting using "-o name" (also tried "-i -o name") only changes the order of finding sets, and not the order of files chosen within a set.

AlexdeTaranto avatar Sep 15 '22 13:09 AlexdeTaranto