/dir/ect/ory/ contains n folders each containing r files. Of which a certain number are the same file with a different file extension. These files are both in the same folder. Is there a simple way to remove one file type but keep the other only a duplicate exists? For example:
/dir/ect/ory/1/myfile1.foo
/dir/ect/ory/1/myfile1.bar
/dir/ect/ory/1/myfile2.foo
/dir/ect/ory/1/myfile3.bar
/dir/ect/ory/2/myfile4.foo
/dir/ect/ory/2/myfile4.bar
Running the command would look something like the following:
duplicate-remove --recursive /dir/ect/ory/ --keep=*.bar
and would produce the result:
/dir/ect/ory/1/myfile1.bar
/dir/ect/ory/1/myfile2.foo
/dir/ect/ory/1/myfile3.bar
/dir/ect/ory/2/myfile4.bar
As you can see, I'm left with file1, file2, file3, file4 and no duplicates, but not all the files called *.foo were deleted, only the file with a *.bar duplicate.
Note also that it is only the file name I'm interested in comparing, not the the file size or data.
(A GUI program would be ok also)