Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.


  Search this Thread
Old 11-03-2003, 06:19 PM   #1
LQ Newbie
Registered: Nov 2003
Distribution: Mandrake 9.1
Posts: 3

Rep: Reputation: 0
ls -l behavior

A while back [Mandrake 8.2 or 9.0?] Mandrake changed the way that 'ls -l' sorted - it became case-insensitive. I believe RH also changed this behavior around the same time.

Is there any way to change it back to the old way [dot files first, capital letters second, then lower case letters 3rd]?


Old 11-04-2003, 03:47 PM   #2
Registered: Jun 2003
Location: Currently Denmark
Distribution: Ubuntu 11.10
Posts: 334

Rep: Reputation: 30
I can tell you as much as that RH is certainly not case insensitive - Example below.

ls - l

- in a random directory gave me:

drwxrwxr-x 11 jabba jabba 4096 Nov 2 14:33 area51
-rwxr-xr-x 1 jabba jabba 20480 Aug 14 21:59 docs.tar
drwxrwxr-x 7 jabba jabba 4096 Aug 14 01:43 documents
drwxrwxr-x 6 jabba jabba 4096 Oct 23 22:37 imagemix
drwxr-xr-x 2 jabba jabba 4096 Sep 28 14:25 jackisdn
drwxr-xr-x 2 jabba jabba 4096 Sep 7 18:00 jakup
drwxrwxr-x 3 jabba jabba 4096 Oct 5 09:49 jrejdk_runtimes
-rw-rw-rw- 1 jabba jabba 23306240 Aug 14 22:45 mozilla.tar
drwxrwxr-x 6 jabba jabba 4096 Oct 1 17:31 openoffice
drwxrwxr-x 6 jabba jabba 4096 Nov 4 18:50 OpenOffice.org1.1.0
-rw-rw-r-- 1 jabba jabba 1381 Nov 4 22:27 output.txt
drwxrwxr-x 6 jabba jabba 4096 Oct 26 15:15 programmir
-rw-r--r-- 1 root root 299 Aug 4 11:41 readtracks.out
-rw-r--r-- 1 jabba jabba 138105 Oct 25 20:40 Screenshot-1.png
-rw-r--r-- 1 jabba jabba 121365 Oct 25 20:41 Screenshot.png
-rwxr-xr-x 1 jabba jabba 230184960 Aug 14 22:06 storage.tar
drwxrwxr-x 6 jabba jabba 4096 Oct 27 14:45 storeage
drwxr-xr-x 2 jabba jabba 4096 Oct 23 23:49 unknown - unknown
-rw-rw-r-- 1 jabba jabba 74240 Oct 3 15:46 viewer.exe
-rwxr-xr-x 1 root root 74240 Jul 17 00:21 viewer.orginal.exe
total .... bla bla


ls -L - gave me

unknown - unknown

As you can see typing ls using -l or -L gave two different responses as do most other CLI orders... (and yes it does look messy down there and in several different languages too...)

Unix is case sensitive - so is Linux and I doubt think Red Hat nor Mandrake will be meddling with CLI orders which are at the very core of the Operating system and changing how they work... But then again I could be wrong.

The only thing I can say for sure is that RH is case senSitIVe
Old 11-05-2003, 03:08 AM   #3
LQ Newbie
Registered: Nov 2003
Distribution: Mandrake 9.1
Posts: 3

Original Poster
Rep: Reputation: 0
just as I thought

Looks like RH has the same problem, as your post pointed out. As I wrote above, ls -al should produce files in this order:

-rw-r--r--    1 vjl   vjl .about
-rw-r--r--    1 vjl   vjl .big
-rw-r--r--    1 vjl   vjl About
-rw-r--r--    1 vjl   vjl Big
-rw-r--r--    1 vjl   vjl about
-rw-r--r--    1 vjl   vjl big
As you wrote, the files, .big, Big, and big would all be next to each other, which is not the way they should be sorted. Remeber that dot files are first, then files beginning with a capital letter are 2nd, and files that start with a small letter are 3rd to be sorted. This goes back to the days of AT&T *NIX.

It turns out the solution to this is to set LC_COLLATE=C in /etc/sysconfig/i18n

RH did the same thing with RH8, apparently [i haven't used RH since 5.0].

Old 11-05-2003, 07:30 AM   #4
Registered: Sep 2003
Location: Iowa, US
Distribution: MDK Since V6.5
Posts: 570

Rep: Reputation: 30
Check the alias on your system. ls hasn't changed at all but they may have added option to with an alias command.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shutdown Behavior rhb327 Slackware 19 11-07-2004 09:39 PM
changing vi behavior scabies Linux - General 5 10-08-2004 08:03 AM
Shutdown behavior patkim Linux - General 2 09-15-2004 01:52 PM
Nautilus behavior benjithegreat98 Fedora 12 05-26-2004 08:43 AM
strange behavior abhijit Linux - General 3 07-09-2003 11:25 PM > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 06:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration