It is necessary to find all the files that contain a specific string. I usually do this:
grep -rl 'Текст' /path/to/dir however, now it was necessary to search the files in cp1251 encoding. The old version no longer works. How to do?
The solution was found:
find path/to/dir/ -exec grep -il "`echo 'Текст'|iconv -f utf8 -t cp1251`" '{}' \; > result.txt Source: https://ru.stackoverflow.com/questions/51145/
All Articles
LANG=ru_RU.CP1251 grep -rl 'Текст' /path/to/dir, the terminal settings should be CP1251. For example, in Gnome Terminal or Putty this can be done in a couple of clicks. - chernomyrdin