Re: case insensitive ls listing?
According to Alex Malinovich,
> On Tue, 2005-03-29 at 12:17 -0500, Roberto C. Sanchez wrote:
> > Quoting Kamaraju Kusumanchi <kk288@cornell.edu>:
> >
> > > This is one of my long standing problems. Is there a way to make the
> > > listing of ls case insensitive?
> > >
> > > for example if in a directory, I do
> > >
> > > ls -someoption tem
> > >
> > > it should show all the files such as
> > >
> > > tem, Tem, tEm, TEm, TeM, TEM etc...
> --snip--
> > Set LANG in your environment to en_US (or any locale other than C that uses
> > dictionary sort and not ASCII sort).
>
> I think what the OP intended was to get ls to treat his input in a
> case-insensitive fashion, not to change the way they're sorted AFTER the
> lookup is done.
>
> I think he essentially wants a shorthand way of doing 'ls
> [tT][eE][mM]*', for example.
>
> The only way I know to do this would be with find:
>
> find . -maxdepth 1 -iname "tem*"
>
> But that's actually MORE typing than
>
> ls [tT][eE][mM]*
Well, that's easy enough to fix.
alias l='find . -maxdepth 1 -iname'
Now you can type
l tem
I saved you an extra character!
Reply to: