Trouble with find's ls and non-english filenames
Hello!
I have a problem with find utility: when I use the option -ls, files with non-English filenames are displayed incorrectly, for example, the output ls command below (this is correct): Code:
~$ ls -l Code:
~$ find . -maxdepth 1 -type f -ls |
info find
3.3.2.3 Unusual Characters in File Names Unfortunately find considers utf unusual. A workaround would be find -type f | xargs ls -l |
Thanks, then I have two ways: either use the command shown above you, or to rebuild the find, adding support for UTF-8. Well, try. Wondered why the developers have added support for UTF-8 in the new versions?
|
I assume you meant "whether", not "why"?
find 4.2.2 as shipped w/ Debian does the same thing as you describe. I think the reason for NOT changing the behaviour is that the developers are concerned the change might break lots of existing scripts. Trying to hack utf support into find is certainly an option, but I personally wouldn't venture down that route. If you dislike the | xargs you could always use -exec ls -l {} \; or -exec stat "your format string here" {} \; and just pull out the fields you really want, anyway. |
Quote:
Quote:
|
Quote:
you'll have to do it every time your distro updates find-utils, and for me that would be too much hassle, specially if there's easy work-arounds that don't cause too much overhead. Quote:
a native English speaker. ;} Quote:
Cheers, Tink |
All times are GMT -5. The time now is 01:49 PM. |