fdupes icon indicating copy to clipboard operation
fdupes copied to clipboard

Search dupes for a specific file type/extension

Open angus73 opened this issue 10 years ago • 6 comments

Is there any way to search for duplicates only in a subset of files, matching for example a given extension? Thanks

angus73 avatar Oct 09 '14 06:10 angus73

I would probably create a temporary folder and use find to filter the original files and generate hard links in the temp folder.

Something like this, (quick and untested),

cd ~/tmp_folder
find ~/source_folder '*.jpg' -exec ln {} . \;

Test it first in a small set of files.

rubenvarela avatar Oct 10 '14 14:10 rubenvarela

a quicker, one line, solution to this is:

fdupes -r . | grep -e '.js$' -e '^$' | uniq

Essentially, this removes any lines from the output of fdupes that either have the extension in question or are blank, then uses uniq to consolidate the blank lines.

thavelick avatar Dec 02 '15 21:12 thavelick

Thank you rubenvarela and thavelick ... I will surely give your hints a try (haven't dealt with this any more, actually)

angus73 avatar Dec 03 '15 07:12 angus73

voting also for this option. include (or exclude) extensions to compare.

EdwinKM avatar Jun 01 '20 18:06 EdwinKM