On Mon, 30 Sep 2002, Tim Wright wrote:

> uniq -d -W1
>
>   This command prints out all duplicated items, looking only at the first
>   field, which is any characters before a '.', space or tab.

oops, I lied. uniq will compare the filename only (the bit before the
first whitespace), but will only print out one of the matches, so you'll
know matching filenames, and know where one of them is, but have to do
another find to get them.

This is what you actually want:

for file in `find . -printf '%f\n' | sort | uniq -d -W1 ` ; do find . -name "${file}" 
; echo ; done

(but it won't find files with different extensions. Try putting '-s .' as
an argument to uniq to use '.' as a seperator).

tim
http://www.cosc.canterbury.ac.nz/~tnw13

Quidquid latine dictum sit, altum viditur.

Reply via email to