Created
September 21, 2019 13:08
-
-
Save belkinai/0746a5a317877463eac4e4f8af16ddec to your computer and use it in GitHub Desktop.
Find case collisions of files in directory and subdirectories
This file contains 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
#!/bin/bash | |
for dir in $(find $1 -type d) | |
do | |
cd $dir | |
for file in $(find . -maxdepth 1 -type f | tr '[A-Z]' '[a-z]'| sed "s#./##" | sort -u) | |
do | |
if [ $(ls|grep -iwc $file) -gt 1 ] | |
then | |
echo "$dir" | |
ls|grep -iw $file | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment