1

I use Double Commander as my file manager for my desktop. It sorts my audio equipment files like this: AU-217.jpg AU-2900.jpg AU-666.jpg

This is also what I get when I do ls -l in a terminal window. But with Caja file manager it shows: AU-217.jpg AU-666.jpg AU-2900.jpg

If I use an image viewer (mcomix, nomacs) I get the same sorting behavior. It drives me nuts. I use shell scripts that use the "logical" sort and when I then use the image viewers I get confusing input. If the filenames contain hex numbers sorting is completely unfathomable. How do I get rid of this "natural" sort behavior?

3
  • Do you use more than 1 language settings? Check the setting of LC_COLLATE during each. Natural listing is part of that setting. But it is far easier to change your file names and append zero padding to the digits. Mind that command line "ls" and "sort" disables LC_COLLATE if using with -v and it then uses ASCII sorting. see gnu.org/software/coreutils/manual/… Commented Sep 22, 2024 at 7:26
  • Thanx! I already did the filename[C].jpg trick (rename function in Double Commander where C is 00...99) but with 3k files that's a bit troublesome. Will look into the LC_COLLATE locale setting. I have some reading up to do... Commented Sep 22, 2024 at 7:33
  • It looks like this sort follows ISO14651. I tried setting LC_COLLATE=C but that doesn't change the unwanted sort behavior of my image viewers. Commented Sep 22, 2024 at 10:18

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.