Skip to content

Instantly share code, notes, and snippets.

@belkinai
Created September 21, 2019 13:08
Show Gist options
  • Save belkinai/0746a5a317877463eac4e4f8af16ddec to your computer and use it in GitHub Desktop.
Save belkinai/0746a5a317877463eac4e4f8af16ddec to your computer and use it in GitHub Desktop.
Find case collisions of files in directory and subdirectories
#!/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