0

I have a large number of files of mixed format spread over eight directories on an external hard drive.

I know I can use fdupes to sort and remove duplicates on the drive.

Is there any way to command fdupes to search within only specified directories on the drive and omitting the others?

For example: Eight directories on drive - A, B, C, D, E, F, G, H.

I wish to search for duplicates within directories A, B, E, and F but exclude C, D, E and H.

Can anyone point me towards the correct syntax to enable this please?

K7AAY
  • 17,202
Pat
  • 11
  • Try fdupes CDEH --recurse: ABEF -nfmq and see if it shows the desired result. If it does, then modify the command line to actually delete instead of list. – K7AAY Oct 22 '19 at 18:19

1 Answers1

0

Thank you for your suggestion. Sadly however, your suggestion did not work, but with a little experimentation, I think I have found the solution.

Using my original example (above) I used the command:

~$ fdupes -ndN /path/to/drive {A,B,E}

I found this deletes duplicates within the specified folders {A.B.E} only, in accordance with the parameters set (-ndN), and ignores the rest of the directories on the drive.

It also works for subdirectories under a parent directory if the path is modified.

Pat
  • 11