Created
November 14, 2015 03:35
-
-
Save nahurst/63a691c29111dfd2d82e to your computer and use it in GitHub Desktop.
Find duplicate file names on OS X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# because we don't have findsn with fslint, we need to do it ourselves | |
# find . -type f -exec basename {} \; | \ # get the name of the file. could be substituted to do hashes here | |
# sort | \ # prep for counting | |
# uniq -c | \ # count occurences | |
# grep -v "^[ \t]*1 " | \ # mind the formatting | |
# awk '{print $2}' | \ # get only the file names, not the counts | |
# xargs -I {} find . -name '{}*' # find the location of the duplicates | |
find . -type f -exec basename {} \; | \ | |
sort | \ | |
uniq -c | \ | |
grep -v "^[ \t]*1 " | \ | |
awk '{print $2}' | \ | |
xargs -I {} find . -name '{}*' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment