I’m in the process of switching my machines to Linux Mint from Windows and on my network drive I have a bunch of folders that are sorted with the help of preceding underscores (like this “__folder1” “___folder2”)) so that folders appear in a specific order.
When my Mint machines access the drive they sort by the first letter skipping the underscores and I’d really like to have that functionality back rather than having to rename a bunch of folders to try to sort them again. (I’d like to avoid a preceding ‘A’ workaround if possible as there’s a bunch of folders)
Any suggestions? A setting I’m missing (very likely) or something?
Edit: The more I look the more it looks like I’m going to have to make a custom locale to be able to get the sorting I want from the default Mint file manager.
- pmk ( @pmk@lemmy.sdf.org ) 2•4 months ago
Are you using Caja file manager? If there’s no setting, it could be that the authors of that file manager just wanted it that way. You can try other file managers like thunar and see if they are different?
The default file manager on Mint in Nemo
But I’ll do some more trawling in the settings and look into a new file manager if I can’t find a setting for it
- pmk ( @pmk@lemmy.sdf.org ) 3•4 months ago
Ah, I see. It seems like you’re not the only one wanting this behavior, there is a workaround that might work: https://github.com/linuxmint/nemo/issues/2085#issuecomment-487007720
- thingsiplay ( @thingsiplay@beehaw.org ) 5•4 months ago
add
export LC_COLLATE=C
to your “~/.profile”, log off, log back on.I’m not sure if this is a good idea to add it to .profile, which would affect every Bash session and program. Global variable like these should be set for the applications you want to affect and not more to avoid side effects, if possible.
- Papamousse ( @Frederic@beehaw.org ) 3•4 months ago
yup, my ll alias is like this for yyyeeaaarrrrsssss because of this
alias ll='LC_COLLATE=C ls -alFh'
It’s kinda worked
Now the underscores appear between uppercase names and lowercase names
So it’s a step in the right direction for me for sure now that they’re at least bunched together
- thingsiplay ( @thingsiplay@beehaw.org ) 2•4 months ago
That’s exactly what the last 2 comments from the previously linked issue thread is saying too. According to a comment from Stack Overflow, the LC_COLLATE=C environmental variable setting is dependent on the system locale, which will
This is likely caused by a difference in locale. In the en_US.UTF-8 locale, underscores (_) sort after letters and numbers, whereas in the POSIX C locale they sort after uppercase letters and numbers, but before lowercase letters.
-- https://stackoverflow.com/questions/1184268/unix-sort-treatment-of-underscore-character
So either way, this setting is wrong for your use case. And it shouldn’t be set in .profile all applications by default as well, unless you know what you are doing. You can use this variable with specific applications only too. But as explained, this would not solve your issue anyway.