[plug] Find similarly named files in directories

Timothy White weirdit at gmail.com
Fri Jan 12 20:06:42 WST 2007


Grrr, seems my email didnt' send properly?!?!

Anyway, a simple find all files of same name.... Change the find to
search what you want, for now it'll recursively search the directory
your in.

find |sed -r 's/.*\/(.*)/\0 \1/'|sort -k 2|uniq
--all-repeated=separate -f 1| sed 's/[^ ]*$//'

I was rather impressed with this once I wrote it... It actually works
nicely!! You could do more funky thinks, like I've seen a script that
finds all dupes, and outputs a "shell script" with lots of rm lines to
remove the files, all commented out.
So simply, if you are searching for duplicate files, fdupes, searching
for files named the same, then the command above.
Oh, if the name has spaces in it, tough it'll probably break. :p

Give that a go.

Tim
-- 
Linux Counter user #273956
Don't email joeblogs at scouts.org.au



More information about the plug mailing list