Unlike in any other file manager I used, Nautilus ignores leading “_” or “-” when sorting files by name. At the same time, it doesn’t ignore “#” (puts files at the bottom) and “$” (puts files at the top of the list).
It seems strange, and I get that the difference lies in the sorting libraries used, but what would be the practical reason for such behavior? I get that “_” and “-” often replace spaces, but not as the leading symbol.
Are there any plugins to tweak it? I got tons of folders with “_archive” and “_export” to scan the repos quickly. Those include folders on the linked servers, so changing my naming convention through the console wouldn’t be a viable solution for me.
Sorry for being needy or the way I write. I am a depressed Ukrainian who switched to Linux a month ago. And GitLab doesn’t let me open a ticket because it treats a lot of Ukrainian IPs as compromised. Oh happy days!
Does that mean my Australia-based locale may have some strange tweaks? Or does Nautilus have its separate locales?
I didn’t even know locales are responsible for sorting. Mine is essentially ISO based. Although the date and time formats in Nautilus suggest that it doesn’t sync with my overall locale.
Although I still don’t imagine skipping leading underscores being a useful thing, I get that it would be a pain to make custom setups that factor in all these language-specific things.
So will probably just change my default shortcut to open nautilus through “LC_ALL=C”.
Use env LC_ALL=C nautilus <arguments> as command, instead of LC_ALL=C nautilus <arguments>. The latter only works when you invoke it from a shell. The env program lets you run other programs with a modified environment.
What Bassi said. Nautilus is using utf8_collate_key_for_filename which says right in the docs that it is locale dependent.
I suggest trying to use different locales for LC_MESSAGES and LC_TIME instead of attempting to add a custom environment variable as it would change the sorting behavior across all programs. Try to change the base language of the graphical user interface from the settings to be US, but change the format locale to what you need for date and time, monetary, etc. A graphical session restart is required for the switch to take effect.
Use locale to know which locale is used for which category.