LINUX.ORG.RU

find, xargs, iconv

anonymous
()

создай скрипт

> echo 'cat $1 | iconv -f CP1251 -t UTF-8 >> /tmp/$$.cv && mv /tmp/$$.cv $1' > ~/cp1251_to_utf8.sh

сделай его исполняемым > chmod u+x ~/cp1251_to_utf8.sh

затем включай поиск по заданным параметрам и примени к результатам этот скрипт

>find /home/ -type f -iname \*.txt -exec ~/cp1251_to_utf8.sh {} \;

fMad ★★
()

$ apt-cache show convmv

Description: filename encoding conversion tool
 convmv can convert a single filename, a directory tree or all files
 on a filesystem to a different encoding. It only converts the
 encoding of filenames, not files contents. A special feature of
 convmv is that it also takes care of symlinks: the encoding of the
 symlink's target will be converted if the symlink itself is being
 converted.
 .
 It is also possible to convert directories to UTF-8 which are already
 partially UTF-8 encoded.

anonymous
()

Спасибо всем =)

anonymous
()
Ответ на: комментарий от anonymous

>It only converts the encoding of filenames, not files contents

чукча не читатель, чукча писатель?

maloi ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.