Skip to content

Instantly share code, notes, and snippets.

@nottrobin
Created October 7, 2015 00:27
Show Gist options
  • Select an option

  • Save nottrobin/24fb23f08afb65d6c49d to your computer and use it in GitHub Desktop.

Select an option

Save nottrobin/24fb23f08afb65d6c49d to your computer and use it in GitHub Desktop.
Recursively find duplicate filenames in a directory tree
#!/bin/sh
dirname=Pictures
find $dirname -type f | sed 's_.*/__' | sort| uniq -d|
while read fileName
do
find $dirname -type f | grep "$fileName"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment