1. check files with same extension and same size
2. use some hash function (md5, md6 suppose to be better)

The first is not very reliable because the name is not part of the file. The file can have no extension.
The second is rather slow on large files.

I suppose there are some more effective methods.