how to find duplicate files with find ?

hello all
I like to make search on files , and the result need to be the files that are duplicated?

Duplicated by name or by content?

by name
also nice to know .. how by content
thanks

pipe output from find -type f through basename (in a script only) and then through uniq -d

E.g. 1.sh:

#!/bin/sh
find -type f | while IFS= read vo
do
echo `basename "$vo"`
done

Then

$ ./1.sh | uniq -d

can you explain me please what is : "while = IFS read vo? "
I can find it in man while ...
can it be one liner?
Thanks allot

This is to handle files with spaces in filenames (IFS= removes internal space field separator)

I dont know how to make this in one line (becouse of besaname syntax, it cannot read filenames from stdin)

By the way, to compare files by content you can use cmp command (but you need to compare each file with each).

thanks one more question
how can i add something that will show me the file path?
i also like to see all the files that are duplicates i change abit the script to :

#!/bin/sh
find . -type f -name "*.*" | while IFS= read vo
do
echo `basename "$vo" | ls -l`
done

but it still dont give me the path
thanks

This is wrong becouse I remove path from filename for uniq utility to compare filenames that prints duplicate entries. E.g. if you have 3 files ./1/file, ./2/file, ./3/anotherfile then script will print
file
file
anotherfile
and uniq -d will print only
file
(a duplicate one).
Then you can use find -type f -name "file" to find out path to the file. It will print
./1/file
./2/file