ls -l

ls -l

Post by Manish Jai » Sat, 05 Oct 2002 23:41:58



hello,

i just realized today that in linux ( redhat 7.3 ),
`ls -l` doesnot distinguish between filenames begining
in capital letter from those in small letter.
for eg ( output from linux )
-rwxr-xr-x    1 jain     stud       728576 Mar 22  2002
PAM02_presentation.ppt
-rw-r--r--    1 jain     stud       119425 Jun 21 15:27 papers.bib
drwxr-xr-x    8 jain     stud          512 Sep  9 16:26 pathload
drwxr-xr-x    5 jain     stud          101 Sep 21 11:03 Pathload

whereas output in unix ( or *bsd ) looks like
-rwxr-xr-x    1 jain     stud       728576 Mar 22  2002
PAM02_presentation.ppt
drwxr-xr-x    5 jain     stud          101 Sep 21 11:03 Pathload
-rw-r--r--    1 jain     stud       119425 Jun 21 15:27 papers.bib
drwxr-xr-x    8 jain     stud          512 Sep  9 16:26 pathload

Any guess as to whether the behavior of `ls -l` in linux was
desired by its designers or is this a bug ??

Please cc a response to me too.

Thanks,
--

Manish Jain
www.cc.gatech.edu/~jain

 
 
 

ls -l

Post by Fran?ois-Xavier Detournièr » Sun, 06 Oct 2002 00:03:21


Strange, on my Linux (Slackware 7.0), Capital letters appears first and then
I have the small letters, as for BSD



Quote:> hello,

> i just realized today that in linux ( redhat 7.3 ),
> `ls -l` doesnot distinguish between filenames begining
> in capital letter from those in small letter.
> for eg ( output from linux )
> -rwxr-xr-x    1 jain     stud       728576 Mar 22  2002
> PAM02_presentation.ppt
> -rw-r--r--    1 jain     stud       119425 Jun 21 15:27 papers.bib
> drwxr-xr-x    8 jain     stud          512 Sep  9 16:26 pathload
> drwxr-xr-x    5 jain     stud          101 Sep 21 11:03 Pathload

> whereas output in unix ( or *bsd ) looks like
> -rwxr-xr-x    1 jain     stud       728576 Mar 22  2002
> PAM02_presentation.ppt
> drwxr-xr-x    5 jain     stud          101 Sep 21 11:03 Pathload
> -rw-r--r--    1 jain     stud       119425 Jun 21 15:27 papers.bib
> drwxr-xr-x    8 jain     stud          512 Sep  9 16:26 pathload

> Any guess as to whether the behavior of `ls -l` in linux was
> desired by its designers or is this a bug ??

> Please cc a response to me too.

> Thanks,
> --

> Manish Jain
> www.cc.gatech.edu/~jain

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.394 / Virus Database: 224 - Release Date: 03/10/02

 
 
 

ls -l

Post by Paul Kimot » Sun, 06 Oct 2002 00:18:04


[posted and e-mailed]



> i just realized today that in linux ( redhat 7.3 ),
> `ls -l` doesnot distinguish between filenames begining
> in capital letter from those in small letter.
> for eg ( output from linux )
> -rwxr-xr-x    1 jain     stud       728576 Mar 22  2002
> PAM02_presentation.ppt
> -rw-r--r--    1 jain     stud       119425 Jun 21 15:27 papers.bib
> drwxr-xr-x    8 jain     stud          512 Sep  9 16:26 pathload
> drwxr-xr-x    5 jain     stud          101 Sep 21 11:03 Pathload

> whereas output in unix ( or *bsd ) looks like
> -rwxr-xr-x    1 jain     stud       728576 Mar 22  2002
> PAM02_presentation.ppt
> drwxr-xr-x    5 jain     stud          101 Sep 21 11:03 Pathload
> -rw-r--r--    1 jain     stud       119425 Jun 21 15:27 papers.bib
> drwxr-xr-x    8 jain     stud          512 Sep  9 16:26 pathload

> Any guess as to whether the behavior of `ls -l` in linux was
> desired by its designers or is this a bug ??

This depends on your locale.

$ LC_COLLATE=en_US ls -l
total 0
-rw-r--r--    1 kimoto   kimoto          0 Oct  4 11:12 a
-rw-r--r--    1 kimoto   kimoto          0 Oct  4 11:12 B
-rw-r--r--    1 kimoto   kimoto          0 Oct  4 11:12 C
$ LC_COLLATE=C ls -l
total 0
-rw-r--r--    1 kimoto   kimoto          0 Oct  4 11:12 B
-rw-r--r--    1 kimoto   kimoto          0 Oct  4 11:12 C
-rw-r--r--    1 kimoto   kimoto          0 Oct  4 11:12 a

To find out the current state of your locale variables (at least on Linux),
run "locale".

(As far as I know, the place to look up locales is in the glibc
documentation.)

--
Paul Kimoto
This message was originally posted on Usenet in plain text.  Any images,
hyperlinks, or the like shown here have been added without my consent,
and may be a violation of international copyright law.

 
 
 

ls -l

Post by Steve Holdowa » Sun, 06 Oct 2002 00:19:49


On Fri, 4 Oct 2002 10:41:58 -0400, Manish Jain


>hello,

>i just realized today that in linux ( redhat 7.3 ),
>`ls -l` doesnot distinguish between filenames begining
>in capital letter from those in small letter.
>for eg ( output from linux )
>-rwxr-xr-x    1 jain     stud       728576 Mar 22  2002
>PAM02_presentation.ppt
>-rw-r--r--    1 jain     stud       119425 Jun 21 15:27 papers.bib
>drwxr-xr-x    8 jain     stud          512 Sep  9 16:26 pathload
>drwxr-xr-x    5 jain     stud          101 Sep 21 11:03 Pathload

>whereas output in unix ( or *bsd ) looks like
>-rwxr-xr-x    1 jain     stud       728576 Mar 22  2002
>PAM02_presentation.ppt
>drwxr-xr-x    5 jain     stud          101 Sep 21 11:03 Pathload
>-rw-r--r--    1 jain     stud       119425 Jun 21 15:27 papers.bib
>drwxr-xr-x    8 jain     stud          512 Sep  9 16:26 pathload

>Any guess as to whether the behavior of `ls -l` in linux was
>desired by its designers or is this a bug ??

>Please cc a response to me too.

>Thanks,

I think they wanted it to behave more like windoze. It started not
long ago, in 7.something. And as far as I know, there's no switch to
put it back to normal.

Steve

 
 
 

ls -l

Post by Dan Espe » Sun, 06 Oct 2002 00:45:02



> hello,

> i just realized today that in linux ( redhat 7.3 ),
> `ls -l` doesnot distinguish between filenames begining
> in capital letter from those in small letter.
> for eg ( output from linux )
> -rwxr-xr-x    1 jain     stud       728576 Mar 22  2002
> PAM02_presentation.ppt
> -rw-r--r--    1 jain     stud       119425 Jun 21 15:27 papers.bib
> drwxr-xr-x    8 jain     stud          512 Sep  9 16:26 pathload
> drwxr-xr-x    5 jain     stud          101 Sep 21 11:03 Pathload

> whereas output in unix ( or *bsd ) looks like
> -rwxr-xr-x    1 jain     stud       728576 Mar 22  2002
> PAM02_presentation.ppt
> drwxr-xr-x    5 jain     stud          101 Sep 21 11:03 Pathload
> -rw-r--r--    1 jain     stud       119425 Jun 21 15:27 papers.bib
> drwxr-xr-x    8 jain     stud          512 Sep  9 16:26 pathload

> Any guess as to whether the behavior of `ls -l` in linux was
> desired by its designers or is this a bug ??

Its a sort issue.
Try it after doing this:

export LC_ALL=C

then try:

man sort

Quote:> Please cc a response to me too.

Sorry, ask here, get the answer here.
 
 
 

ls -l

Post by Jim » Sun, 06 Oct 2002 00:53:21



> Any guess as to whether the behavior of `ls -l` in linux was desired by
> its designers or is this a bug ??

It is not a bug. I don't recall the exact version the sort order changed.

You can change the sort order back to the "old way" by changing the
LC_COLLATE environment variable. Try this to see the difference. This will
only change the sort order for this one command.

env LC_COLLATE=C ls -l

If you want the "old way" back for all users add LC_COLLATE=C to
/etc/sysconfig/i18n. Or if you just want to change it for yourself add
LC_COLLATE=C to your ~/.i18n. If ~/.i18n doesn't exist create it.

Regards,
        Jim H

 
 
 

ls -l

Post by Ed Blackma » Sun, 06 Oct 2002 16:29:08



> On Fri, 4 Oct 2002 10:41:58 -0400, Manish Jain

>>Any guess as to whether the behavior of `ls -l` in linux was
>>desired by its designers or is this a bug ??

> I think they wanted it to behave more like windoze. It started not
> long ago, in 7.something. And as far as I know, there's no switch to
> put it back to normal.

Add "LC_COLLATE=POSIX" to your environment.  Insert it in
/etc/sysconfig/i18n on Redhat to make the change system-wide.

What happened is that locale support matured over the last couple of
years, so distributions started including it.  The sorting rules for
English are different than the POSIX sorting rules that some of us are
used to: you won't find many dictionaries that have a separate section
for words that start with 'A' instead of 'a'.

Ed