How to find all files recursively from the specified directory with at least one of any Cyrillic characters in the name. Team

find ../folder/ -regex '[A-я]+' 

finds nothing. Where am I wrong?

  • At a minimum, your team says - find the files, whose name consists only of the characters А-я (there most likely will be left symbols, the range is written incorrectly) - KoVadim

2 answers 2

  1. according to the documentation:

    -regex pattern
    This is a match on the whole path, not a search.

    i.e., the template must match the whole path (and name) of the file, and not just the required part (as, for example, when using the grep program):

     .*[набор].* 
  2. The set of letters from А to Я and from A to я should look different:

     [А-Яа-я] 

total:

 $ find путь -regex '.*[А-Яа-я].*' 
  • one
    But what about Eo ? .. - Qwertiy
  • one
    @Qwertiy, with more or less modern glibc - excellent: find . -regex '.*[А-Яа-я].*' find . -regex '.*[А-Яа-я].*' , result: ./abcdЁ123 ./abcdё123 . - aleksandr barakin pm
  • thanks, earned. Yes, the path, of course, must be complete - while1pass

The team should look at least that way.

 find ../folder/ -regex '.*[A-Яа-я].*' 
  • one
    А-я - by, and where is Ё ? - Qwertiy
  • about Ah — ore, and Eo ... it's a matter of taste. I still do not understand why it was not included in the list correctly. - KoVadim
  • @KoVadim, what does "not included in the list" mean? - aleksandr barakin
  • In the literal sense of the word. But here I looked at the unicode table and I will say that А-я is quite a valid and correct range (but only for utf-8) unicode-table.com/ru/blocks/cyrillic - KoVadim
  • one
    for example: echo -e '1\nё\nЁ' | grep '[а-Я]' echo -e '1\nё\nЁ' | grep '[а-Я]' on a more or less current version of glibc will return two lines, with the letter ё , and with the letter Ё with the environment variable LC_COLLATE with the value of язык_страна.UTF-8 . - aleksandr barakin