[SOLVED] Nemo's sort by name underscoreFoldername not on top?!?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
RemonK
Level 4
Level 4
Posts: 395
Joined: Wed Feb 06, 2019 6:32 pm
Location: Land van Umme
Contact:

[SOLVED] Nemo's sort by name underscoreFoldername not on top?!?

Post by RemonK »

I have lots of folder structures with folders beginning with one or more underscores! In m$ DOS/Windows that works flawless. And by doing so you can categorize your folders and sort by name.
1 underscore A-Z
2 underscores A-Z
etc

In Linux that looks like an effin mess!! How can i solve that??? Nemo can't handle it..

m$
Schermafdruk van 2019-09-02 05-29-23.png
Schermafdruk van 2019-09-02 05-29-23.png (4.36 KiB) Viewed 2924 times
Linux
Schermafdruk van 2019-09-02 06-18-57.png
Schermafdruk van 2019-09-02 06-18-57.png (6.23 KiB) Viewed 2924 times
I have 100's of folders like this organized this way with the underscore and now i pull my hair out to find something!? :cry:
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Het leven is net een kartbaan; Sensatie, adrenaline en veel te snel voorbij!
Joeptjoep - Feestboek
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by rene »

Windows does not define what is "right". Sorting in Nemo is influenced by localisation, specifically the LC_COLLATE environment variable, but there isn't in fact a locale that specifies anything quite as ridiculous as sorting underscores first; when unlocalised, LC_COLLATE=C, the _ sorts exactly where it should, i.e., between uppercase and lowercase: http://www.asciitable.com. LC_COLLATE=WINDOWSWEENIE no one has as of yet implemented.

... which is not to say by the way that a file-manager such as KDE's Dolphin cannot adhere to your peculiar wishes, but nautilus/nemo is for now a Linux file manager, not a Windows one.
RemonK
Level 4
Level 4
Posts: 395
Joined: Wed Feb 06, 2019 6:32 pm
Location: Land van Umme
Contact:

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by RemonK »

rane wrote: Mon Sep 02, 2019 1:27 am Windows does not define what is "right".
What has that to do with it? Were did i mention that? Or are you just sour Linux didn't think of that first? :lol:
"Lissen kaarfully Rane, i wiel tell dies oonly wans!"
The fact is that i have a lot of folders archived this way when i worked on a windows box and now on a linux box it is a mess! I don't like a mess and i don't want to rename them all, so i asked for a fix in Linux! What i didn't ask for was a rant about your mental fittie with windows!

rane wrote:Sorting in Nemo is influenced by localisation, specifically the LC_COLLATE environment variable, but there isn't in fact a locale that specifies anything quite as ridiculous as sorting underscores first;
Well, not everybody is meant to see the brilliance in everything! ;)

rane wrote: when unlocalised, LC_COLLATE=C, the _ sorts exactly where it should, i.e., between uppercase and lowercase: http://www.asciitable.com. LC_COLLATE=WINDOWSWEENIE no one has as of yet implemented.
I tried LC_COLLATE=LINUXLOOSER but after a reboot my beautifull desktop was gone and came into a crappy terminal!

rane wrote:... which is not to say by the way that a file-manager such as KDE's Dolphin cannot adhere to your peculiar wishes, but nautilus/nemo is for now a Linux file manager, not a Windows one.
If that were the case i would have dumped m$ years ago!!

Oh and next time you get out of your bed, try your other leg first!
But thanx anyway for pointing me into the right direction (that must have hurt! :lol: )
Het leven is net een kartbaan; Sensatie, adrenaline en veel te snel voorbij!
Joeptjoep - Feestboek
ColdBootII

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by ColdBootII »

Hi RamonK,

Don't get this wrong - using special characters in folder/file names is poor practice that could potentially lead to unforeseeable and undesirable effects/issues. You would be better off and safer devising a numbering scheme to achieve your specific purpose i.e. use zeros instead of underscores.

Edit: Alright an underscore is not a special character in Linux :oops: but still, stick with alphanumeric naming and you won't ever have to depend on collating sequences.

Cheers.
RemonK
Level 4
Level 4
Posts: 395
Joined: Wed Feb 06, 2019 6:32 pm
Location: Land van Umme
Contact:

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by RemonK »

At the beginning of times, this archive once started with the name 'Tape1'! Because that's what you did those days when you made a backup! You sat down, carefully selected your preciouse files and copied them to your tapedrive! (yes i'm old) And through time that backup grew bigger and bigger! So there came a time i had to purchase another one,'Tape2', eventually a 'Tape3' and a 'Tape4'. Untill the day came and harddrives got bigger and cheaper, so you just put an extra hdd in your system and copied all your stuff to that drive. Then Tape2, Tape3 and 4 were copied into Tape1 and that kept growing! In that time i had my own way of categorise my files and folders.. none, 1, 2 or 3 underscores. It may not be the best way, it may not be the prittiest way, but i did it myyyyy waaayyyyy! ;)

In other words, i am used to it, i can dream my way of categorize my stuff, it is almost 30 years old and it has NEVER EVER gave me any error in any kind of way!! (untill Linux came onto my path) And if Linux has a problem with underscores, then i find that kind of strange, because underscores are very common used in filenames! But this 'windowsweenie' is not here to discuss who's OS has the biggest p#nis, i came here for a solution! And no, renaming my system is no solution. For me making the step to Linux is time consuming enough!
Het leven is net een kartbaan; Sensatie, adrenaline en veel te snel voorbij!
Joeptjoep - Feestboek
ColdBootII

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by ColdBootII »

RemonK wrote: Mon Sep 02, 2019 4:38 am And no, renaming my system is no solution. For me making the step to Linux is time consuming enough!
Why not? I'm sure, renaming is a breeze and what would it matter if you are looking at zeros instead of underscores as long as sorting is correct? Did you get out of your bed on the wrong foot today, which is why you can't be flexed about it? :mrgreen:

Cheers :D
RemonK
Level 4
Level 4
Posts: 395
Joined: Wed Feb 06, 2019 6:32 pm
Location: Land van Umme
Contact:

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by RemonK »

For once i think zero's are ugly before a name.. underscores are nice and you almost can't see them!
30 years of habit got nothing to do with feet, i like my way! And this system is here to serve ME, not the other way around!
So in short, nothing wrong with my archive system, only linux refuses to cooperate with it!
ONLY for that i'm searching for a solution! ;)

And just when i thought linux is un-endly flexible i hit the first wall! (it's users! :lol: )
Het leven is net een kartbaan; Sensatie, adrenaline en veel te snel voorbij!
Joeptjoep - Feestboek
ColdBootII

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by ColdBootII »

Hi RamonK,

I must say, what I posted above is in fact not a solution and also, you do use special characters in the names of the files. a single quotes is a special character in Linux. Maybe it works somehow in your Windows setup and perhaps it could be setup the same way in Linux but what I now noticed from your post above, is, all these are in fact the backup folders.

Naming them that way is inadequate. I'm not sure how you know which is which and from what date? Perhaps, you like your way best, but dates would be more up to it e.g. 2019090201 - the last 2 digits denoting the first, the second, etc backup during a particular date if there were more than one.

Edit: And the descending/ascending sorting order would be impeccable. The fact that you can get it your way in Windows is a lucky coincidence, only you can't rely on coincidence when dealing with software/machine sorting. So, using underscores was a mistake from the very start, IMO.

Cheers.
gm10

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by gm10 »

RemonK wrote: Mon Sep 02, 2019 5:55 am So in short, nothing wrong with my archive system, only linux refuses to cooperate with it!
ONLY for that i'm searching for a solution! ;)

And just when i thought linux is un-endly flexible i hit the first wall! (it's users! :lol: )
But Linux is flexible. As mentioned above, non-GNOME-based file manager like e.g. Dolphin will do what you want and sort like you're used to from Windows (or mostly, Windows actually ignores a leading hyphen while sorting, just not an underscore). The choice is yours. ;)
Last edited by gm10 on Mon Sep 02, 2019 7:51 am, edited 3 times in total.
ColdBootII

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by ColdBootII »

gm10 wrote: Mon Sep 02, 2019 6:35 am i.e. like you're used to from Windows
Hi gm, :D

Not necessarily... Let's say he "accidentally" changes code page settings in Windows, all his "neat" sorting could go amiss, as well. Apart from that, who names backups folders "___AAA, __BBSHOULDBEBEFORE___AA", anyways? :lol: I don't think this is to be taken for serious, it's just nitpicking... :mrgreen:
Last edited by ColdBootII on Mon Sep 02, 2019 7:52 am, edited 1 time in total.
gm10

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by gm10 »

ColdBootII wrote: Mon Sep 02, 2019 7:39 am Apart from that, who names backups folders "___AAA, __BB", anyways?
Leading underscore or exclamation point are very standard ways on Windows of sorting folders to the top. Leading numbers is more of a Linux thing (and much uglier). I guess Nemo can now pin folders to the top though.
Last edited by gm10 on Mon Sep 02, 2019 7:57 am, edited 1 time in total.
ColdBootII

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by ColdBootII »

^Yes, I know that, but would you name any of your backup folders "__BBISBEFORE____A"? :lol:
polarvortex

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by polarvortex »

Obviously those are example folder names shown to explain how they should sort under his method.

Based on what rene said, can't he just make his own LC_COLLATE, sorting underscores above letters? Or does that have undesirable effects across the os?
gm10

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by gm10 »

polarvortex wrote: Mon Sep 02, 2019 9:02 am Based on what rene said, can't he just make his own LC_COLLATE, sorting underscores above letters? Or does that have undesirable effects across the os?
Besides affecting the sorting of some other applications? No, it's safe, doing it myself both for underscore and exclamation mark. Consistency is king. Here's an example on how to do it: http://svmiller.com/blog/2019/07/notes- ... bettersort, although personally I just edited the source file directly. From my postinst script:

Code: Select all

sudo sed -i "s/<U0021> IGNORE;/<U0021> <RES-1>;/" -e "s/<U005F> IGNORE;/<U005F> <RES-1>;/" /usr/share/i18n/locales/iso14651_t1_common
sudo locale-gen
ColdBootII

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by ColdBootII »

polarvortex wrote: Mon Sep 02, 2019 9:02 am Obviously those are example folder names shown to explain how they should sort under his method.
Yes, examples not bearing any semblance with the actual naming used.
Tape2, Tape3 and 4 were copied into Tape1
which make more sense particularly if there is sufficient number of padding zeros as in Tape00001, Tape00002... now that can't be disordered irrespective of OS/collating/code-page combination.
RemonK
Level 4
Level 4
Posts: 395
Joined: Wed Feb 06, 2019 6:32 pm
Location: Land van Umme
Contact:

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by RemonK »

ColdBootII wrote: Mon Sep 02, 2019 9:50 am
polarvortex wrote: Mon Sep 02, 2019 9:02 am Obviously those are example folder names shown to explain how they should sort under his method.
Yes, examples not bearing any semblance with the actual naming used.
Tape2, Tape3 and 4 were copied into Tape1
which make more sense particularly if there is sufficient number of padding zeros as in Tape00001, Tape00002... now that can't be disordered irrespective of OS/collating/code-page combination.
How old are you? Did you really not understand that ___AAA was an example??? Wow, i have to lower my standards then..
And NO the folders are NOT named 'Tape1' but Tape1 without the single quotes..

Were double facepalms are not enough!!
0e8bc30b13ff71d5cd49b90ab68edfba.jpg

@gm10 thanx, i will look into that!
Het leven is net een kartbaan; Sensatie, adrenaline en veel te snel voorbij!
Joeptjoep - Feestboek
ColdBootII

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by ColdBootII »

RemonK wrote: Mon Sep 02, 2019 10:31 am
How old are you? Did you really not understand that ___AAA was an example??? Wow, i have to lower my standards then..
And NO the folders are NOT named 'Tape1' but Tape1 without the single quotes..

Were double facepalms are not enough!!
Old enough not to use memes where and when that is inappropriate.

Yes, "___AAA" (quotes because I'm referring to what you've typed here so, you see, I also have to lower my standards) is an example you wouldn't use anyway. Why bring it up then? But, If you're really using "Tape1, Tape2" etc. as a naming convention for your backups without zero padding, you'll end up with Tape10, if you have that many, showing before Tape2 even on Windows doing it "youuuur waaaay".

That (and that meme) tells much of your age and experience.
gm10

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by gm10 »

ColdBootII wrote: Mon Sep 02, 2019 11:08 am If you're really using "Tape1, Tape2" etc. as a naming convention for your backups without zero padding, you'll end up with Tape10, if you have that many, showing before Tape2 even on Windows doing it "youuuur waaaay".
Not to get involved in your little war but that flame attempt crashed and burned. Both Windows Explorer and many/most Linux file managers will sort Tape10 after Tape9. Try again? ;)
RemonK
Level 4
Level 4
Posts: 395
Joined: Wed Feb 06, 2019 6:32 pm
Location: Land van Umme
Contact:

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by RemonK »

ColdBootII wrote: Mon Sep 02, 2019 11:08 am Old enough not to use memes where and when that is inappropriate.
14? 15 maybe...? :roll: You really have nothing better to do? Aren't there new levels of your hello kitty game yet?
Het leven is net een kartbaan; Sensatie, adrenaline en veel te snel voorbij!
Joeptjoep - Feestboek
User avatar
Moem
Level 22
Level 22
Posts: 16233
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Nemo's sort by name underscoreFoldername not on top?!?

Post by Moem »

Gentlefolks, can we keep the emotional outbursts to a minimum on all sides please, and focus on a more constructive attitude?
I'd appreciate it.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
Locked

Return to “Beginner Questions”