ls command sort options

David A. Bandel david
Mon May 17 11:37:28 PDT 2004


On Wed, 11 Sep 2002 09:41:57 -0400 (EDT)
begin  Net Llama! <netllama at linux-sxs.org> spewed forth:

> On Wed, 11 Sep 2002, Brad De Vries wrote:
> 
> > Does anyone know of a way to sort the files in the a
> > directory the way 'ls' used to sort them?
> >
> > Over the last 15 years I've gotten used to 'ls -al'
> > sorting the files with &#34;.&#34; files first,
> > uppercase files second, lowercase files last.  Now the
> > 'ls' command seems to ignore case and the &#34;.&#34;.
> >
> > E.g., if I have 3 files in my current directory:
> >   .bashrc
> >   README
> >   auction

This is correct, and my ls does this on COL 3.1.1 (and all previous
versions.

> >
> > When I do a simple 'ls -al' I expect to see the files
> > in the order listed above.  Unfortunately, I'm getting
> > them in the following order:
> >   auction
> >   .bashrc
> >   README

Well, that's borken.

> >
> > I've read through the man pages and the info pages but
> > have not found the option '--sort-like-it-used-to'.
> >
> > Any help would be appreciated.
> >
> > Brad.
> >
> > P.S. 'ls --version' reveals 4.1
> 
> Seeing how you mentioned 15 years, you couldn't possibly be using the
> Gnu version of ls way back then, hence the reaon why things don't work
> the same under linux.

Excuse me Lonnie, but I've been using GNU ls for over 10 years on various
architectures, and this new way is borken.

I suggest you get the source, there's probably a switch for sorting the M$
way you need to turn off.

Last time I compiled the fileutils source, it sorted correctly, so it's
definitely either an rc file (probably in /etc) or a compile time
absurdity that has to be turned off.

What distro?

Ciao,

David A. Bandel
-- 
Focus on the dream, not the competition.
		-- Nemesis Racing Team motto


More information about the Linux-users mailing list