adrianlopezroche / fdupes

FDUPES is a program for identifying or deleting duplicate files residing within specified directories.
2.42k stars 186 forks source link

Feature request: Keep the oldest/newest file #113

Open nuriakman opened 5 years ago

nuriakman commented 5 years ago

Need option for deleting files: Keep old file (by file creation time) and delete others Keep new file (by file creation time) and delete others

This parameter may be shortcut for ORDER and/or REVERSE ORDER parameters.

adrianlopezroche commented 5 years ago

I'm trying not to add too many command-line options. If --delete and --noprompt along with the proper choice of order will produce the desired effect, then there's really no reason to add yet another option.

BTW, there's no such thing as file creation time in Unix. There's modification time, change time, and access time, but no creation time.

On Tue, Dec 25, 2018, 5:52 AM vedia <notifications@github.com wrote:

Need option for deleting files: Keep old file (by file creation time) and delete others Keep new file (by file creation time) and delete others

This parameter may be shortcut for ORDER and/or REVERSE ORDER parameters.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adrianlopezroche/fdupes/issues/113, or mute the thread https://github.com/notifications/unsubscribe-auth/AF8J_c-sU8pQZM4-WQk1hHZxZ9g3_h18ks5u8fVwgaJpZM4Zg-Y4 .

nuriakman commented 5 years ago

Modification time also possible. You know, duplicate files mostly created by copy and paste. Also files have copied from mobile phones or USB drives more than once.

adrianlopezroche commented 5 years ago

fdupes --delete --noprompt --order=time [directory] to keep oldest files.

Add --reverse to keep newest files instead.

On Tue, Dec 25, 2018, 2:48 PM vedia <notifications@github.com wrote:

Modification time also possible. You know, duplicate files mostly created by copy and paste. Also files have copied from mobile phones or USB drives more than once.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/adrianlopezroche/fdupes/issues/113#issuecomment-449867840, or mute the thread https://github.com/notifications/unsubscribe-auth/AF8J_XwNAj7h-0vMCoN2VmJ0w8EY4Ob5ks5u8nMLgaJpZM4Zg-Y4 .

moonshiner commented 5 years ago

Just this week I was cursing and thinking fdupes should have some of that --exclude type logic rsync/diff uses. But barring that, when -1 is selected, I would like to select the separator value instead of ' '. I had a bunch of dupes that were in a mixed order and I ended up dumping all the names with -1 and then doing a bunch of chicanery to split the lines into two fields since many files had spaces already. maybe "-1 --sameline=" where the default is " " ?