find -regextype -h: Tipo desconhecido de expressão regular ‘-h’; tipos válidos são:
‘findutils-default’,
‘ed’,
‘emacs’,
‘gnu-awk’,
‘grep’,
‘posix-awk’,
‘awk’,
‘posix-basic’,
‘posix-egrep’,
‘egrep’,
‘posix-extended’,
‘posix-minimal-basic’,
‘sed’.
find -regextype awk -not -iregex "[^áàãâéêíóõôúçñ]+"
find -depth -regextype awk -not -iregex "[0-9a-z \-\_\,\./]+"
find -depth -regextype posix-awk -not -iregex "[0-9a-z \-\_\,\./]+"
Comando que busca apenas arquivos com a última parte acentuada
find -depth -regextype posix-awk -iregex ".*[áàãâéêíóõôúçñ]+[^/]+"
Comando que busca apenas arquivos com qualquer parte acentuada
find -depth -regextype awk -not -iregex "[0-9a-z/ \-\_\,\.\(\)]+"
Comando que encontra arquivos com final fora da norma, mas inclui .
find -depth -regextype posix-awk -not -iregex ".*/[0-9a-z/ \-\_\,\.\(\)]+" |\
while read infile;
do
if [ $infile != '.' ];
then
bnamefile="$(basename "$infile")";
outfile="$(echo "$bnamefile" | iconv -f UTF8 -t ASCII//TRANSLIT)";
bnamedir="$(dirname "$infile")";
echo $bnamefile $outfile;
mv -vi "$infile" "$bnamedir/$outfile";
fi
done
find -regextype awk -not -regex "[^áÁàÀãÃâÂéÉêÊíÍóÓõÕôÔúÚçÇñÑ]+" \
| awk '{print length, $0}' \
| sort -nr \
| sed 's/^[[:digit:]]* //' \
| while read dirfile; \
do
outfile="$(echo "$(basename "$dirfile")" | unaccent UTF-8)"; \
mv -iv "$dirfile" "$(dirname "$dirfile")/$outfile"; \
done
find -depth -regextype posix-awk -iregex ".*[áàãâéêíóõôúçñ]+[^/]+" |\
while read infile;
do
bnamefile="$(basename "$infile")";
outfile="$(echo "$bnamefile" | iconv -f UTF8 -t ASCII//TRANSLIT)";
bnamedir="$(dirname "$infile")";
echo $bnamefile $outfile;
mv -vi "$infile" "$bnamedir/$outfile";
done
find -depth -regextype posix-awk -iregex ".*[áàãâéêíóõôúçñ]+[^/]+" |\
while read infile;
do
bnamefile="$(basename "$infile")";
outfile="$(unaccent UTF-8 $bnamefile)";
bnamedir="$(dirname "$infile")";
echo $bnamefile $outfile;
rename -n "s/$bnamefile/$outfile/" "$infile";
done