[clug] RH /bin/ls listing

Hong Bo Zhong hongbo.zhong at abs.gov.au
Fri Jun 20 16:38:41 EST 2003



Spot on.  It was en_AU.  Thanks for the help.

Cheers,
HongBo



|--------+------------------------>
|        |          Martin Pool   |
|        |          <mbp at samba.org|
|        |          >             |
|        |                        |
|        |          20/06/2003    |
|        |          04:30 PM      |
|        |                        |
|--------+------------------------>
  >----------------------------------------------------------------------------|
  |                                                                            |
  |      To:     Hong Bo Zhong/Staff/ABS                                       |
  |      cc:     linux at lists.samba.org                                         |
  |      Subject:     Re: [clug] RH /bin/ls listing                            |
  >----------------------------------------------------------------------------|




On 20 Jun 2003, Hong Bo Zhong <hongbo.zhong at abs.gov.au> wrote:

> I normally use Debian and FreeBSD.  Recently I have to work with a few RH
> boxes (8.0+) and I find this directory listing problem annoying.  Basically,
> the dot and non-dot files, the upper-cases and the lower-cases are all mixed
> up.  This was not the case prior to RH 8 if I remember correctly.
>
> $ /bin/ls -la
> ...
> drwxr-xr-x    3 hongbo   ctn             4096 Jan  7  2002 .sawfish
> drwxr-xr-x    4 hongbo   ctn             4096 Jun 20 15:44 src
> drwx------    2 hongbo   ctn             4096 Dec  2  2002 .ssh
> drwxr-xr-x    3 hongbo   ctn             4096 Dec 23 11:29 .terminfo
> drwx------    2 hongbo   ctn             4096 Apr 29 11:34 .themes
> drwxr-xr-x    3 hongbo   ctn             4096 Jun 20 11:52 tmp
> -rw-------    1 hongbo   ctn             6365 Jun  4 16:56 .viminfo
> drwx------    3 hongbo   ctn             4096 Dec 28  2001 .xauth
> -rw-------    1 hongbo   ctn              167 Jun 20 12:14 .Xauthority
> -rwxr-xr-x    1 hongbo   ctn              188 Apr 30  2001 .Xclients
> -rwxr-xr-x    1 hongbo   ctn               57 Apr 30  2001 .Xclients-default
> -rw-------    1 hongbo   ctn              265 Jun  4 10:28 .xfigrc
> -rw-------    1 hongbo   ctn             1156 Jun 20 12:14 .xsession-errors
> $ /bin/ls --version
> ls (coreutils) 4.5.3
> Written by Richard Stallman and David MacKenzie.
>
> Copyright (C) 2002 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>

> I did a strace(1), apart from indicating that /bin/ls consults the locale
> and color settings, it didn't provide much useful information regarding the
> problem.  It appears to me that the sorting is done internally by /bin/ls.
> RTFM and STFW.  No option seems to be available to correct this.  I am
> wondering it is a compile time option.  Could someone please offer a
> helping hand?

You may have set your language preferences such that it sorts text in
this order (i.e. ignoring dots and case.)  You can find out what it's
set to with the 'locale' command.

I think setting LC_COLLATE=C will put it back to a plain ascii sort.

--
Martin






-----------------------------------------------
ABS Web Site:  www.abs.gov.au




More information about the linux mailing list