Find files with non-ascii characters in filename

Is there a way that I can have find

non-ascii character files? I could use a pipe of course and filter files with perl, but for efficiency I would like to set the whole thing to find

. I tried the following:

find . -type f -name '*[^[:ascii:]]*'

      

it doesn't work at all.

Edit

Now I am trying to use

find . -type f -regex '.*[^[:ascii:]].*'

      

It is emacs regexp and has a class [:ascii:]

. But the expression I'm trying to use doesn't work.

Edit 2 :

LC_COLLATE=C find . -type f -regex '.*[^!-~].*'

      

matches files with non-ascii characters (full voodoo ...). But it also matches files with a space in the name.

-1


source to share


1 answer


This works for me in both default and advanced mode:

LC_COLLATE=C find . -regex '.*[^ -~].*'

      



However, there may be locale related issues and I don't have a lot of non-ascii filenames content to check, but it catches the ones I have.

+2


source







All Articles