title: How to find duplicate filenames (recursively) in a given directory? BASH
body: <p>I need to find every duplicate filenames in a given dir tree. I dont know, what dir tree user will give as a script argument, so I dont know the directory hierarchy. I tried this:</p>
  
  <pre><code>#!/bin/sh
  find -type f | while IFS= read vo
  do
  echo `basename "$vo"`
  done
  </code></pre>
  
  <p>but thats not really what I want. It finds only one duplicate and then ends, even, if there are more duplicate filenames, also - it doesnt print a whole path (prints only a filename) and duplicate count. I wanted to do something similar to this command:</p>
  
  <pre><code>find DIRNAME | tr '[A-Z]' '[a-z]' | sort | uniq -c | grep -v " 1 " 
  </code></pre>
  
  <p>but it doenst work for me, dont know why. Even if I have a duplicates, it prints nothing.
  I use Xubuntu 12.04. </p>