Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #200880

Re: ls -la sort order

From Lee <ler762@gmail.com>
Newsgroups linux.debian.user
Subject Re: ls -la sort order
Date 2018-10-03 21:00 +0200
Message-ID <wEUxj-3P0-3@gated-at.bofh.it> (permalink)
References (1 earlier) <wER6p-1Ys-7@gated-at.bofh.it> <wESlP-2D1-1@gated-at.bofh.it> <wESvv-2Gf-11@gated-at.bofh.it> <wETBg-3h4-7@gated-at.bofh.it> <wETKV-3zv-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 10/3/18, Roberto C. Sánchez <roberto@debian.org> wrote:
> On Wed, Oct 03, 2018 at 01:51:54PM -0400, Lee wrote:
>>
>> Sure - I can understand some people wanting A a to sort together.  But
>> ignoring non-alpha characters when sorting???  Eventually I'm sure I
>> can get used to
>>   Music
>>   old
>>   Pictures
>>
>> but this order is obnoxious
>>   .mozilla
>>   Music
>>   old
>>   Pictures
>>   .profile
>>   Public
>>
>
> While it may not particularly intuitive, I would not call it obnoxious.
> In English, the '.' would not customarily be used to make lexical
> sorting decisions.
>
> Dr. Jiles
> Dr Jones
> Dr. Jurgenson
>
> That would be the sort order I expect (for English, or most any other
> natural language locale).

Which is probably why I'm having such a hard time accepting the
en_US.utf8 sort order.  I want the "computer" rules, not the natural
language rules.

> Either of
>
> Dr Jones
> Dr. Jiles
> Dr. Jurgenson
>
> or
>
> Dr. Jiles
> Dr. Jurgenson
> Dr Jones
>
> would seem incorrect to me.

<grin> what seems incorrect to me is that the data isn't normalized.
I'd do something like
  sed -e 's/^Dr /Dr. /' | sort

>  I suspect that collation function has no
> way of knowing whether the punctuation is important or not, so it must
> adhere to the rules specified in the locale (to ignore it in this case).
> You could always write a custom locale that sorts punctuation before or
> after letters, as you like.  The locale(5) man page would be a good
> place to start for that.

ok - I'll take a look

>> I don't think I'll ever get used to that.  I'm just a bit concerned
>> that setting LC_COLLATE=C is going to break something & I'll have a
>> heck of a time figuring out it was because I changed the sort order.
>>
>
> Call me old school, but I have LC_COLLATE=C in every shell profile on
> every machine that I use.  I find that sorting is most important to me
> at the shell prompt (and usually when using ls).  There has never been
> instance where I encountered an oddity that I even suspected related to
> my choice of LC_COLLATE.

Good to know!  Thank you
Lee

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

ls -la sort order Lee <ler762@gmail.com> - 2018-10-03 17:10 +0200
  Re: ls -la sort order Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-03 17:20 +0200
    Re: ls -la sort order Lee <ler762@gmail.com> - 2018-10-03 18:40 +0200
      Re: ls -la sort order Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-03 18:40 +0200
      Re: ls -la sort order Roberto C. Sánchez <roberto@debian.org> - 2018-10-03 18:50 +0200
        Re: ls -la sort order Lee <ler762@gmail.com> - 2018-10-03 20:00 +0200
          Re: ls -la sort order Roberto C. Sánchez <roberto@debian.org> - 2018-10-03 20:10 +0200
            Re: ls -la sort order Lee <ler762@gmail.com> - 2018-10-03 21:00 +0200
          Re: ls -la sort order Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-03 20:10 +0200

csiph-web