I have a field that contains windows file paths, like so:
\\\\fs1\\foo\\bar\\snafu.txt
c:\\this\\is\\why\\i\\drink\\snafu.txt
\\\\fs2\\bippity\\baz.zip
\\\\f
You can easily strip the path up to the last directory separator with an expression like
regexp_replace(path, '^.+[/\\]', '')
This will match the ocassional forward slashes produced by some software as well. Then you just count the remaining file names like
WITH files AS (
SELECT regexp_replace(my_path, '^.+[/\\]', '') AS filename
FROM my_table
)
SELECT filename, count(*) AS count
FROM files
GROUP BY filename
HAVING count(*) >= 2;