GNU bug report logs - #21890
"ls -l" strange alphabetical order

Previous Next

Package: coreutils;

Reported by: Andreas Papadopoulos <papandre92 <at> gmail.com>

Date: Thu, 12 Nov 2015 16:34:01 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 21890 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Andreas Papadopoulos <papandre92 <at> gmail.com>, 21890 <at> debbugs.gnu.org
Subject: Re: bug#21890: "ls -l" strange alphabetical order
Date: Thu, 12 Nov 2015 17:56:49 +0000
tag 21890 notabug
close 21890
stop

On 12/11/15 14:15, Andreas Papadopoulos wrote:
> I am experiencing a strange bug when executing "ls -l" on my machine running Xubuntu 14.04.3, Terminal Emulator 0.6.3 and ls --version 8.21.
> 
> As you can see in the png attachment after running "ls -l" the files "kati.xml", "kati2.xml", "kati3.xml" are wrongly sorted. I assume the correct order is "kati.xml", "kati2.xml", "kati3.xml" and not the one displayed in the picture.
> 
> Thank you in advance

This is due to '.' being ignored in your locale:

$ LC_ALL=en_US ltrace -e strcoll ls -l
ls->strcoll("kati.xml", "kati3.xml")                      = 30
ls->strcoll("kati2.xml", "kati3.xml")                     = -1

$ LC_ALL=C ltrace -e strcoll ls -l
ls->strcoll("kati.xml", "kati3.xml")                      = -5
ls->strcoll("kati2.xml", "kati.xml")                      = 4
ls->strcoll("kati2.xml", "kati3.xml")                     = -1

You might want to consider alias ls='ls -v'

thanks,
Pádraig




This bug report was last modified 6 years and 210 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.