Caminhos com nomes / caracteres reservados:
LC_ALL=C find . -name '*[[:cntrl:]<>:"\|?*]*' \
-o -iname 'CON' \
-o -iname 'PRN' \
-o -iname 'AUX' \
-o -iname 'NUL' \
-o -iname 'COM[1-9]' \
-o -iname 'LPT[1-9]' \
-o -name '* ' \
-o -name '?*.'
Teste:
$ cd -- "$(mktemp --directory)"
$ touch foo \ LPT9 'space ' 'dot.'
$ LC_ALL=C find . -name '*[[:cntrl:]<>:"\|?*]*' -o -iname 'CON' -o -iname 'PRN' -o -iname 'AUX' -o -iname 'NUL' -o -iname 'COM[1-9]' -o -iname 'LPT[1-9]' -o -name '* ' -o -name '?*.'
./dot.
./space
./LPT9
./\
Caminhos que são idênticos ao ignorar maiúsculas e minúsculas ( não funciona com caminhos contendo novas linhas ):
find . | sort | LC_ALL=C tr '[:upper:]' '[:lower:]' | uniq -c | grep -v '^ 1 ' | cut -c '9-'
Teste:
$ cd -- "$(mktemp --directory)"
$ touch foo bar BAR
$ find . | sort | LC_ALL=C tr '[:upper:]' '[:lower:]' | LC_ALL=C uniq -c | grep -v '^ 1 ' | cut -c '9-'
./bar
Caminhos com mais de MAX_PATH
(260 caracteres):
find "$PWD" | while IFS= read -r path
do
if [ "${#path}" -gt 260 ]
then
printf '%s\n' "$path"
fi
done
Teste:
$ cd -- "$(mktemp --directory)"
$ touch foo 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
$ find "$PWD" | while IFS= read -r path
> do
> if [ "${#path}" -gt 260 ]
> then
> printf '%s\n' "$path"
> fi
> done
/tmp/tmp.HEANyAI8Hy/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345