Filenames are sorted in wrong order
Hi. I just started using Mandrake 10.0 Official Edition recently, and I noticed that the filenames are sorted in a strange way: they seems to be sorted by only alphanumeric characters, and other characters are ignored.
Example, make 3 empty files "T-02", "T01", and "T03", by using Code:
more /dev/null > T01 Code:
T01 This behavior is not just in Konqueror, but it is systemwide. I.E., when I get the same behavior of sorting when I use "ls" in Konsole, and even a file manager program that I downloaded: Krusader. I even tried different partitions and filesystems. I tried on FAT32, Ext3, and ReiserFS, all give me the same result. Is there some hidden setting in some configuration file to change this?? I have been reading help and man pages, and I tried to do a search in the forum using keyword "sorted", but nothing related to this ever comes up. So, it seems like I am the only one who has this problem..... :( I am using Mandrake 10.0 Official Edition, kernel 2.6.3, KDE 3.2 BRANCH >= 20040204. Thanks in advance to anyone who can solve this for me. |
LANG=en_US
LC_COLLATE=C Never had an issue with it and don't know precisely how to fix it, but searching for those and like variables may point you in the direction of a solution, as that's what it sounds like - how the system is understanding how to sort things based on language/locale settings. $ ls -1 T0-2 T01 T03 But I could be completely wrong. Incidentally, to create an empty file Code:
$ >empty_file -- Well, it is if you use bash - don't think it works in all shells. Even so 'touch empty_file' is another method. |
I used KDE to set the country and language setting. But when I type "set" in Konsole, I get the following:
Code:
LANG=en_US.UTF-8 P.S. Thanks for the tips about the command to generate an empty file. Quote:
|
Seems to be. I just did
export LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8:en_US:en LC_ADDRESS=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 and screwed up my sorting just like yours. Exporting LC_COLLATE=C again fixed it. If you export that in, um, Konsole, or whatever you use, and then try it, it should work, but you may need to log out entirely to get it to take effect everywhere. Plus, for all I know, KDE resets itself and I have no idea how to fix that. - I went poking around and it turns out it's set in /etc/profile.d/lang.sh in Slack (and the comments also indicate that's the issue) but that wouldn't be how your system was set up, I don't think. You should still be able to put it in your personal bash configs, at least. |
It works
Thanks. I just added
Code:
export LC_COLLATE=C I don't know where to put that in, and since I couldn't find the file you mentioned (the closest one is /etc/profile.d/10lang.sh, which has the comment at the top that said "# /etc/profile.d/lang.sh - set i18n stuff", and the file look complicated with all those "[ -n xxxx]" stuffs.... yeah, I probably need to learn that stuff soon). So, I added that line of "export" command in /etc/profile and it works. Actually, computer seems a little faster..... probably just my imagination :) Thank you so much for your help. |
All times are GMT -5. The time now is 09:04 AM. |