My writing here concerns a flaw discovered in the majority of file managers that are available thru Linux distributions. The flaw is a problem with alphabetic sorting of files within a directory, some files are not sorted correctly. This problem most often occurs with; Thunar, Nemo, File Manager and PCManFM. I have noticed a trend where in the file name the first space between words starts this flaw of scrambling the appropriate letter in alphabetical order based on type of file format.
I have included this example;
Notice how the 3G1_ files have been separated (scattered) out of alphabetical order. In some situations where hundreds of files exist within a directory (folder) they for some reason appear further away from their correct location within the file directory.
This flaw does not occur when using Dolphin in a Linux operating system or Windows Explorer.
Here is an example viewing the same Directory (Folder);
Why is this flaw occurring? Maybe this problem could be corrected somehow, if so I cannot find any way of adjusting anything within the configuration or user preference menu options of the file managers where this problem is occurring. Hopefully bringing this to attention may start action to correct this flaw by people involved with skills and experience to solve the problem and make the script or programming changes necessary.
If you look at the ASCII tables, the numerical value of the character is usually what determines sorting order, and most sort in order, 1st character, 2nd character, 3rd character, etc. The hex codes are the relevant values.
To us it may seem out of order, but looking at the ascii values that can be explained.
For example a space is ascii 20 which comes before all letters, numbers, and special characters. Caps come before lower case letters, numbers come before all alpha characters, etc.
There is not one sort order. The âsortâ man page tells:
*** WARNING *** The locale specified by the environment affects sort
order. Set LC_ALL=C to get the traditional sort order that uses native
byte values.
The traditional sort order without any lexicographic rules, just order by ascii byte values, is probably what you want, because it takes spaces into account.
Try: âLC_ALL=C pcmanfmâ
Under Mate desktop, this will not work with caja, because another caja is already maintaining the desktop folder. The second one will be launched from the first one missing the LC_ALL=C.
Thanks for this information did not realize that alpha-numeric sorting had variations, thought this process had a universal one standard procedure. Then it is my ignorance about the nuts and bolts details that lead me to believe there may be a flaw. I apologize for the inconvenience, thought I might have found something that brought to the attention of people that are experts could help improve things.
The reason such detail is important involves my web site that I hand coded. Each page (250 in all) is located with all of itâs files with alpha-numeric identification. Some longer than others yet working on each page is so much easier when using a file manager that keeps them together, such as Dolphin in Linux and Explorer in Windows.
As I posted a small segment above the first number describes one of 5 total sections of the web site, followed by an alpha letter that has subsections and further on through the first four characters.
I find it difficult running through this web site directory of over 3,800 files when the organization of all the sections is not kept in order. For some reason Nemo, Nautilus, PCManFM, and Thunar do not keep them in order, every section has the same pattern of scattering some of the files for each page as I showed a small part of a few pages. Thanks for your time and consideration.
I was not aware of this too, only knew some magic from MySQL database called âcollationâ.
Dolphin has an option to configure sort. Default is âNaturalâ, which takes also numbers into account, preventing Pict2 coming behind Pict199. Apparently, this natural sorting handles the spaces better for you. I had the impression that the LxQT variant of pcmanfm does the same, may be because KDE and LxQT share the Qt libraries, offering the âQCollatorâ class.
With ânumericmode= onâ and âignorepunctuation=offâ, it should do the work for Dolphin.
in /etc/locale.conf. Then you donât modify any other locale settings you might want. The word âcollateâ is just another word for âsort orderâ.