Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #7091 > unrolled thread

Case insensitive bash search?

Started byJon Danniken <jonSPAMdanniken@yaSMPAhoo.com>
First post2013-01-25 08:59 -0800
Last post2013-01-25 20:11 -0500
Articles 20 on this page of 23 — 10 participants

Back to article view | Back to comp.os.linux.misc


Contents

  Case insensitive bash search? Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> - 2013-01-25 08:59 -0800
    Re: Case insensitive bash search? Robert Heller <heller@deepsoft.com> - 2013-01-25 11:44 -0600
      Re: Case insensitive bash search? gazelle@shell.xmission.com (Kenny McCormack) - 2013-01-29 13:56 +0000
        Re: Case insensitive bash search? Wayne <nospam@all.invalid> - 2013-01-29 12:41 -0500
    Re: Case insensitive bash search? unruh <unruh@invalid.ca> - 2013-01-25 17:59 +0000
      Re: Case insensitive bash search? Lew Pitcher <lpitcher@teksavvy.com> - 2013-01-25 13:13 -0500
        Re: Case insensitive bash search? Lew Pitcher <lpitcher@teksavvy.com> - 2013-01-25 13:23 -0500
      Re: Case insensitive bash search? Richard Kettlewell <rjk@greenend.org.uk> - 2013-01-25 19:48 +0000
        Re: Case insensitive bash search? ray carter <ray@zianet.com> - 2013-01-25 20:45 +0000
          Re: Case insensitive bash search? Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> - 2013-01-25 14:58 -0800
            Re: Case insensitive bash search? Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> - 2013-01-25 15:28 -0800
              Re: Case insensitive bash search? Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> - 2013-01-25 16:14 -0800
              Re: Case insensitive bash search? Robert Heller <heller@deepsoft.com> - 2013-01-25 19:04 -0600
              Re: Case insensitive bash search? unruh <unruh@invalid.ca> - 2013-01-26 06:51 +0000
        Re: Case insensitive bash search? unruh <unruh@invalid.ca> - 2013-01-26 06:47 +0000
          Re: Case insensitive bash search? unruh <unruh@invalid.ca> - 2013-01-26 16:36 +0000
    Re: Case insensitive bash search? Tim Watts <tw+usenet@dionic.net> - 2013-01-25 20:01 +0000
      Re: Case insensitive bash search? Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> - 2013-01-25 15:01 -0800
        Re: Case insensitive bash search? Tim Watts <tw+usenet@dionic.net> - 2013-01-25 23:36 +0000
          Re: Case insensitive bash search? Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> - 2013-01-25 16:09 -0800
            Re: Case insensitive bash search? Tim Watts <tw+usenet@dionic.net> - 2013-01-26 11:21 +0000
              Re: Case insensitive bash search? Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> - 2013-01-26 15:14 -0800
          Re: Case insensitive bash search? "Chris F.A. Johnson" <cfajohnson@gmail.com> - 2013-01-25 20:11 -0500

Page 1 of 2  [1] 2  Next page →


#7091 — Case insensitive bash search?

FromJon Danniken <jonSPAMdanniken@yaSMPAhoo.com>
Date2013-01-25 08:59 -0800
SubjectCase insensitive bash search?
Message-ID<kdudlt$48h$1@speranza.aioe.org>
Hello,

Is it possible to have the search of a folder with "ll" return all 
case-insensitive results?

As an example, if I search for "*Foo*", I will only get files that have 
the capital "F", but not "foo".

Is there any way to have results returned regardless of case?

Thanks,

Jon

[toc] | [next] | [standalone]


#7092

FromRobert Heller <heller@deepsoft.com>
Date2013-01-25 11:44 -0600
Message-ID<U76dnc-p5fHnWZ_MnZ2dnUVZ_vidnZ2d@giganews.com>
In reply to#7091
At Fri, 25 Jan 2013 08:59:44 -0800 Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> wrote:

> 
> Hello,
> 
> Is it possible to have the search of a folder with "ll" return all 
> case-insensitive results?
> 
> As an example, if I search for "*Foo*", I will only get files that have 
> the capital "F", but not "foo".
> 
> Is there any way to have results returned regardless of case?

Search for "*[Ff]oo*" ?

UNIX file systems use case sensitive file names.  There isn't any
'built-in' case-insensitive file name searching, but you can create a
search pattern with alternives with upper and lower case.

> 
> Thanks,
> 
> Jon
>                              

-- 
Robert Heller             -- 978-544-6933 / heller@deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                                                                                                   

[toc] | [prev] | [next] | [standalone]


#7132

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2013-01-29 13:56 +0000
Message-ID<ke8ke7$vo5$1@news.xmission.com>
In reply to#7092
In article <U76dnc-p5fHnWZ_MnZ2dnUVZ_vidnZ2d@giganews.com>,
Robert Heller  <heller@deepsoft.com> wrote:
>At Fri, 25 Jan 2013 08:59:44 -0800 Jon Danniken
><jonSPAMdanniken@yaSMPAhoo.com> wrote:
>
>> 
>> Hello,
>> 
>> Is it possible to have the search of a folder with "ll" return all 
>> case-insensitive results?
>> 
>> As an example, if I search for "*Foo*", I will only get files that have 
>> the capital "F", but not "foo".
>> 
>> Is there any way to have results returned regardless of case?
>
>Search for "*[Ff]oo*" ?
>
>UNIX file systems use case sensitive file names.  There isn't any
>'built-in' case-insensitive file name searching, but you can create a
>search pattern with alternives with upper and lower case.

Two comments:

1) (As a later poster has noted) Use find and the "-iname" option (GNU
    specific, of course...)

2) Mac OSX "HFS" is case-retentive but not case-sensitive.  I consider Mac
    OSX to be "Unix", but I suppose a pedant might take issue here.  In any
    case, this really threw me for a loop when I first noticed it (on the
    Mac).  I simply couldn't believe my eyes - that I was running Unix on a
    case-insensitive file system.

-- 
Is God willing to prevent evil, but not able? Then he is not omnipotent.
Is he able, but not willing? Then he is malevolent.
Is he both able and willing? Then whence cometh evil?
Is he neither able nor willing? Then why call him God?
~ Epicurus

[toc] | [prev] | [next] | [standalone]


#7134

FromWayne <nospam@all.invalid>
Date2013-01-29 12:41 -0500
Message-ID<510809af$0$2726$9a6e19ea@unlimited.newshosting.com>
In reply to#7132
On 1/29/2013 8:56 AM, Kenny McCormack wrote:
> ...
> 2) Mac OSX "HFS" is case-retentive but not case-sensitive.  I consider Mac
>     OSX to be "Unix", but I suppose a pedant might take issue here.  In any
>     case, this really threw me for a loop when I first noticed it (on the
>     Mac).  I simply couldn't believe my eyes - that I was running Unix on a
>     case-insensitive file system.
> 

As I recall, early Teletypes didn't have a shift key, nor lower-case letters.
I forget the details, but if the username entered at a login prompt was in
all uppercase letters, Unix would switch to a case-insensitive mode for the
rest of the session; "stty lcase" would map all lowercase letters to uppercase
ones.

While POSIX removed that option some time ago, Gnu/Linux systems still
support that option.  I don't think it would solve the OP's problem, but I
thought some might find it interesting.

-- 
Wayne

[toc] | [prev] | [next] | [standalone]


#7093

Fromunruh <unruh@invalid.ca>
Date2013-01-25 17:59 +0000
Message-ID<1KzMs.131493$2v.110871@newsfe05.iad>
In reply to#7091
On 2013-01-25, Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> wrote:
> Hello,
>
> Is it possible to have the search of a folder with "ll" return all 
> case-insensitive results?
>
> As an example, if I search for "*Foo*", I will only get files that have 
> the capital "F", but not "foo".

I do not think ls has such an option. But you could do
ls |grep -i '*foo*' 
which would return the case insensitive result. 
(-i to grep tells it to ignore case)
Or do
ls *[fF]oo*
if you know that it is the F that might be capitalised.

(ll -s just an alias to ls with special arguments  on your system I believe)


>
> Is there any way to have results returned regardless of case?
>
> Thanks,
>
> Jon

[toc] | [prev] | [next] | [standalone]


#7094

FromLew Pitcher <lpitcher@teksavvy.com>
Date2013-01-25 13:13 -0500
Message-ID<hXzMs.86217$LS5.60002@newsfe10.iad>
In reply to#7093
On Friday 25 January 2013 12:59, in comp.os.linux.misc, unruh@invalid.ca
wrote:

> On 2013-01-25, Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> wrote:
>> Hello,
>>
>> Is it possible to have the search of a folder with "ll" return all
>> case-insensitive results?
>>
>> As an example, if I search for "*Foo*", I will only get files that have
>> the capital "F", but not "foo".
> 
> I do not think ls has such an option.

Actually, it does, sort of

If the shell option "nocaseglob" is set, then "bash matches filenames in a 
case-insensitive fashion when performing pathname expansion".

For example, here are the contents of a directory

  ~/tmp $ ls
  A  D  a  b  c  d  e  f

With nocaseglob turned off ("unset")

  ~/tmp $ shopt -u nocaseglob
  ~/tmp $ ls A*
  A

only the file "A" matches a globbing "A*".

However, with nocaseglob turned on ("set")

  ~/tmp $ shopt -s nocaseglob
  ~/tmp $ ls A*
  A  a

a globbing "A*" matches both file "A" and file "a"

Perhaps the OP can use this (in a suitably isolated subshell, so as not to
affect his commandline shell) to get his "case-insensitive results"
from "ll" (an aliased ls(1), I believe).

HTH
-- 
Lew Pitcher
"In Skills, We Trust"

[toc] | [prev] | [next] | [standalone]


#7095

FromLew Pitcher <lpitcher@teksavvy.com>
Date2013-01-25 13:23 -0500
Message-ID<g4AMs.97774$Sl.39995@newsfe27.iad>
In reply to#7094
On Friday 25 January 2013 13:13, in comp.os.linux.misc,
lpitcher@teksavvy.com wrote:

> On Friday 25 January 2013 12:59, in comp.os.linux.misc, unruh@invalid.ca
> wrote:
> 
>> On 2013-01-25, Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> wrote:
>>> Hello,
>>>
>>> Is it possible to have the search of a folder with "ll" return all
>>> case-insensitive results?
>>>
>>> As an example, if I search for "*Foo*", I will only get files that have
>>> the capital "F", but not "foo".
>> 
>> I do not think ls has such an option.
> 
> Actually, it does, sort of
> 
> If the shell option "nocaseglob" is set, then "bash matches filenames in a
> case-insensitive fashion when performing pathname expansion".

Note, this suggestion is predicated on the OP's statement that if he
searches for "*Foo*", [he] will only get files that have the capital "F",
but not "foo".

This implies to me that the OP enters, at his command line, something like
  ls *Foo
(or, perhaps in his case)
  ll *Foo

At this level, filename expansion is performed by the shell, and not by the
aliased ls(1). So, it is shell filename expansion that we have to affect.

ls(1) (and presumably ll) will, without a specific filename argument or
other controls, list /all/ files in the target directory (. or the
specified directory). The "qualified case insensitive list" asked for by
the OP doesn't exist in ls(1), and the existant unqualified list is, in
effect, case-insensitive, as it lists all files, regardless of case.

-- 
Lew Pitcher
"In Skills, We Trust"

[toc] | [prev] | [next] | [standalone]


#7096

FromRichard Kettlewell <rjk@greenend.org.uk>
Date2013-01-25 19:48 +0000
Message-ID<87r4l982oa.fsf@araminta.anjou.terraraq.org.uk>
In reply to#7093
unruh <unruh@invalid.ca> writes:
> On 2013-01-25, Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> wrote:
>> Hello,
>>
>> Is it possible to have the search of a folder with "ll" return all 
>> case-insensitive results?
>>
>> As an example, if I search for "*Foo*", I will only get files that have 
>> the capital "F", but not "foo".
>
> I do not think ls has such an option. But you could do
> ls |grep -i '*foo*' 
> which would return the case insensitive result. 

That won’t work.  grep doesn’t use glob syntax.

-- 
http://www.greenend.org.uk/rjk/

[toc] | [prev] | [next] | [standalone]


#7098

Fromray carter <ray@zianet.com>
Date2013-01-25 20:45 +0000
Message-ID<amg980F91h0U3@mid.individual.net>
In reply to#7096
On Fri, 25 Jan 2013 19:48:05 +0000, Richard Kettlewell wrote:

> unruh <unruh@invalid.ca> writes:
>> On 2013-01-25, Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> wrote:
>>> Hello,
>>>
>>> Is it possible to have the search of a folder with "ll" return all
>>> case-insensitive results?
>>>
>>> As an example, if I search for "*Foo*", I will only get files that
>>> have the capital "F", but not "foo".
>>
>> I do not think ls has such an option. But you could do ls |grep -i
>> '*foo*'
>> which would return the case insensitive result.
> 
> That won’t work.  grep doesn’t use glob syntax.

Simply use 'ls | grep -i foo'.

[toc] | [prev] | [next] | [standalone]


#7099

FromJon Danniken <jonSPAMdanniken@yaSMPAhoo.com>
Date2013-01-25 14:58 -0800
Message-ID<kdv2mc$s28$1@speranza.aioe.org>
In reply to#7098
On 01/25/2013 12:45 PM, ray carter wrote:
> On Fri, 25 Jan 2013 19:48:05 +0000, Richard Kettlewell wrote:
>
>> unruh <unruh@invalid.ca> writes:
>>>
>>> I do not think ls has such an option. But you could do ls |grep -i
>>> '*foo*'
>>> which would return the case insensitive result.
>>
>> That won’t work.  grep doesn’t use glob syntax.
>
> Simply use 'ls | grep -i foo'.

Awesome, thanks Ray, and unruh and Richard as well.  I'll make a script 
for this  so it will be as quick as "ll foo" (maybe "xx foo").

Jon

[toc] | [prev] | [next] | [standalone]


#7101

FromJon Danniken <jonSPAMdanniken@yaSMPAhoo.com>
Date2013-01-25 15:28 -0800
Message-ID<kdv4fh$c1$1@speranza.aioe.org>
In reply to#7099
On 01/25/2013 02:58 PM, Jon Danniken wrote:
> On 01/25/2013 12:45 PM, ray carter wrote:
>> On Fri, 25 Jan 2013 19:48:05 +0000, Richard Kettlewell wrote:
>>
>>> unruh <unruh@invalid.ca> writes:
>>>>
>>>> I do not think ls has such an option. But you could do ls |grep -i
>>>> '*foo*'
>>>> which would return the case insensitive result.
>>>
>>> That won’t work.  grep doesn’t use glob syntax.
>>
>> Simply use 'ls | grep -i foo'.
>
> Awesome, thanks Ray, and unruh and Richard as well.  I'll make a script
> for this  so it will be as quick as "ll foo" (maybe "xx foo").

Okay, so I made the following script for this, and called it "xx":

#! /bin/bash
ls -l | grep -i $1

And it works for my user, by invoking it as ./xx

So now I put it into /usr/bin, so that I can avoid the leading "./", but 
I have to use sudo to run it, despite having the proper permissions:

[root@FED bin]# pwd
/usr/bin
[root@FED bin]# ll xx
-rwx--x--x. 1 root root 37 Jan 25 15:22 xx

Any ideas why I have to run this as root or sudo?

Jon

[toc] | [prev] | [next] | [standalone]


#7104

FromJon Danniken <jonSPAMdanniken@yaSMPAhoo.com>
Date2013-01-25 16:14 -0800
Message-ID<kdv74q$5oo$1@speranza.aioe.org>
In reply to#7101
On 01/25/2013 03:28 PM, Jon Danniken wrote:
>
> Okay, so I made the following script for this, and called it "xx":
>
> #! /bin/bash
> ls -l | grep -i $1
>
> And it works for my user, by invoking it as ./xx
>
> So now I put it into /usr/bin, so that I can avoid the leading "./", but
> I have to use sudo to run it, despite having the proper permissions:
>
> [root@FED bin]# pwd
> /usr/bin
> [root@FED bin]# ll xx
> -rwx--x--x. 1 root root 37 Jan 25 15:22 xx
>
> Any ideas why I have to run this as root or sudo?


After taking a nap on this, it dawned on me that my user would have to 
read the script before executing the script, so adding read permission 
to the script allows my normal user to run it:

[user@FED bin]$ pwd
/usr/local/bin
[user@FED bin]$ ll
-rwxr-xr-x. 1 root root 42 Jan 25 16:01 xx

Thanks again for all the help!

Jon

[toc] | [prev] | [next] | [standalone]


#7105

FromRobert Heller <heller@deepsoft.com>
Date2013-01-25 19:04 -0600
Message-ID<yb-dnQhXZ8Y-tp7MnZ2dnUVZ_sqdnZ2d@giganews.com>
In reply to#7101
At Fri, 25 Jan 2013 15:28:48 -0800 Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> wrote:

> 
> On 01/25/2013 02:58 PM, Jon Danniken wrote:
> > On 01/25/2013 12:45 PM, ray carter wrote:
> >> On Fri, 25 Jan 2013 19:48:05 +0000, Richard Kettlewell wrote:
> >>
> >>> unruh <unruh@invalid.ca> writes:
> >>>>
> >>>> I do not think ls has such an option. But you could do ls |grep -i
> >>>> '*foo*'
> >>>> which would return the case insensitive result.
> >>>
> >>> That won’t work.  grep doesn’t use glob syntax.
> >>
> >> Simply use 'ls | grep -i foo'.
> >
> > Awesome, thanks Ray, and unruh and Richard as well.  I'll make a script
> > for this  so it will be as quick as "ll foo" (maybe "xx foo").
> 
> Okay, so I made the following script for this, and called it "xx":
> 
> #! /bin/bash
> ls -l | grep -i $1
> 
> And it works for my user, by invoking it as ./xx
> 
> So now I put it into /usr/bin, so that I can avoid the leading "./", but 
> I have to use sudo to run it, despite having the proper permissions:
> 
> [root@FED bin]# pwd
> /usr/bin
> [root@FED bin]# ll xx
> -rwx--x--x. 1 root root 37 Jan 25 15:22 xx
> 
> Any ideas why I have to run this as root or sudo?

Wrong permissions.

sudo chmod go+rx /usr/bin/xx

> 
> Jon
> 
>                                                             

-- 
Robert Heller             -- 978-544-6933 / heller@deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                   

[toc] | [prev] | [next] | [standalone]


#7108

Fromunruh <unruh@invalid.ca>
Date2013-01-26 06:51 +0000
Message-ID<K1LMs.124776$Id.52309@newsfe24.iad>
In reply to#7101
On 2013-01-25, Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> wrote:
> On 01/25/2013 02:58 PM, Jon Danniken wrote:
>> On 01/25/2013 12:45 PM, ray carter wrote:
>>> On Fri, 25 Jan 2013 19:48:05 +0000, Richard Kettlewell wrote:
>>>
>>>> unruh <unruh@invalid.ca> writes:
>>>>>
>>>>> I do not think ls has such an option. But you could do ls |grep -i
>>>>> '*foo*'
>>>>> which would return the case insensitive result.
>>>>
>>>> That won???t work.  grep doesn???t use glob syntax.
>>>
>>> Simply use 'ls | grep -i foo'.
>>
>> Awesome, thanks Ray, and unruh and Richard as well.  I'll make a script
>> for this  so it will be as quick as "ll foo" (maybe "xx foo").
>
> Okay, so I made the following script for this, and called it "xx":
>
> #! /bin/bash
> ls -l | grep -i $1
>
> And it works for my user, by invoking it as ./xx
>
> So now I put it into /usr/bin, so that I can avoid the leading "./", but 
> I have to use sudo to run it, despite having the proper permissions:
>
> [root@FED bin]# pwd
> /usr/bin
> [root@FED bin]# ll xx
> -rwx--x--x. 1 root root 37 Jan 25 15:22 xx
>
> Any ideas why I have to run this as root or sudo?

Yes, a script has to be read before it can be executed.
change it to -rwxr-xr-x


>
> Jon
>

[toc] | [prev] | [next] | [standalone]


#7107

Fromunruh <unruh@invalid.ca>
Date2013-01-26 06:47 +0000
Message-ID<XZKMs.55318$On7.15273@newsfe16.iad>
In reply to#7096
On 2013-01-25, Richard Kettlewell <rjk@greenend.org.uk> wrote:
> unruh <unruh@invalid.ca> writes:
>> On 2013-01-25, Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> wrote:
>>> Hello,
>>>
>>> Is it possible to have the search of a folder with "ll" return all 
>>> case-insensitive results?
>>>
>>> As an example, if I search for "*Foo*", I will only get files that have 
>>> the capital "F", but not "foo".
>>
>> I do not think ls has such an option. But you could do
>> ls |grep -i '*foo*' 
>> which would return the case insensitive result. 
>
> That won???t work.  grep doesn???t use glob syntax.

OK you are right but it would have been better had you given the correct
result.
 
grep 'foo'

will work

>

[toc] | [prev] | [next] | [standalone]


#7114

Fromunruh <unruh@invalid.ca>
Date2013-01-26 16:36 +0000
Message-ID<WBTMs.43233$j95.14626@newsfe31.iad>
In reply to#7107
On 2013-01-26, unruh <unruh@invalid.ca> wrote:
> On 2013-01-25, Richard Kettlewell <rjk@greenend.org.uk> wrote:
>> unruh <unruh@invalid.ca> writes:
>>> On 2013-01-25, Jon Danniken <jonSPAMdanniken@yaSMPAhoo.com> wrote:
>>>> Hello,
>>>>
>>>> Is it possible to have the search of a folder with "ll" return all 
>>>> case-insensitive results?
>>>>
>>>> As an example, if I search for "*Foo*", I will only get files that have 
>>>> the capital "F", but not "foo".
>>>
>>> I do not think ls has such an option. But you could do
>>> ls |grep -i '*foo*' 
>>> which would return the case insensitive result. 
>>
>> That won???t work.  grep doesn???t use glob syntax.
>
> OK you are right but it would have been better had you given the correct
> result.
>  
> grep 'foo'
>
> will work

Oops too fast. grep -i "foo" will work. Forgot the key part the -i.

>
>>

[toc] | [prev] | [next] | [standalone]


#7097

FromTim Watts <tw+usenet@dionic.net>
Date2013-01-25 20:01 +0000
Message-ID<2t4bt9-gls.ln1@squidward.local.dionic.net>
In reply to#7091
On Friday 25 January 2013 16:59 Jon Danniken wrote in comp.os.linux.misc:

> Hello,
> 
> Is it possible to have the search of a folder with "ll" return all
> case-insensitive results?
> 
> As an example, if I search for "*Foo*", I will only get files that have
> the capital "F", but not "foo".
> 
> Is there any way to have results returned regardless of case?
> 
> Thanks,
> 
> Jon

find -iname ... -maxdepth 1

Or do you *really* want to do it in the shell?

-- 
Tim Watts                 Personal Blog: http://www.dionic.net/tim/

"A fanatic is one who can't change his mind and won't change the subject."

[toc] | [prev] | [next] | [standalone]


#7100

FromJon Danniken <jonSPAMdanniken@yaSMPAhoo.com>
Date2013-01-25 15:01 -0800
Message-ID<kdv2s6$sl7$1@speranza.aioe.org>
In reply to#7097
On 01/25/2013 12:01 PM, Tim Watts wrote:
> On Friday 25 January 2013 16:59 Jon Danniken wrote in comp.os.linux.misc:
>
>> Hello,
>>
>> Is it possible to have the search of a folder with "ll" return all
>> case-insensitive results?
>>
>> As an example, if I search for "*Foo*", I will only get files that have
>> the capital "F", but not "foo".
>>
>> Is there any way to have results returned regardless of case?
>>
>> Thanks,
>>
>> Jon
>
> find -iname ... -maxdepth 1
>
> Or do you *really* want to do it in the shell?

Thanks Tim.  My reason for trying to do this in the shell (as opposed to 
in a file manager) is because I have some folders with a lot of files in 
them (thousands to tens of thousands), and my file manager (Dolphin - 
KDE) often has problems at times with folders that big.

I find that using the shell is a *lot* quicker than the file manager, 
and very noticeably so when interacting with one of these 
"high-capacity" folders.

Jon

[toc] | [prev] | [next] | [standalone]


#7102

FromTim Watts <tw+usenet@dionic.net>
Date2013-01-25 23:36 +0000
Message-ID<rghbt9-oa9.ln1@squidward.local.dionic.net>
In reply to#7100
On Friday 25 January 2013 23:01 Jon Danniken wrote in comp.os.linux.misc:

> On 01/25/2013 12:01 PM, Tim Watts wrote:
>> On Friday 25 January 2013 16:59 Jon Danniken wrote in comp.os.linux.misc:
>>
>>> Hello,
>>>
>>> Is it possible to have the search of a folder with "ll" return all
>>> case-insensitive results?
>>>
>>> As an example, if I search for "*Foo*", I will only get files that have
>>> the capital "F", but not "foo".
>>>
>>> Is there any way to have results returned regardless of case?
>>>
>>> Thanks,
>>>
>>> Jon
>>
>> find -iname ... -maxdepth 1
>>
>> Or do you *really* want to do it in the shell?
> 
> Thanks Tim.  My reason for trying to do this in the shell (as opposed to
> in a file manager) is because I have some folders with a lot of files in
> them (thousands to tens of thousands), and my file manager (Dolphin -
> KDE) often has problems at times with folders that big.
> 
> I find that using the shell is a *lot* quicker than the file manager,
> and very noticeably so when interacting with one of these
> "high-capacity" folders.

I really meant "are you obsessed with not exec-ing other command binaries"?
That could be a valid concern on a crappy little embedded system, but not 
usually a problem on a normal system - unless you are trying to aim for 100% 
portability across loads of unices - where you cannot assume GNU extensions 
etc.

-- 
Tim Watts                 Personal Blog: http://www.dionic.net/tim/

"She got her looks from her father. He's a plastic surgeon."

[toc] | [prev] | [next] | [standalone]


#7103

FromJon Danniken <jonSPAMdanniken@yaSMPAhoo.com>
Date2013-01-25 16:09 -0800
Message-ID<kdv6ra$53e$1@speranza.aioe.org>
In reply to#7102
On 01/25/2013 03:36 PM, Tim Watts wrote:
> On Friday 25 January 2013 23:01 Jon Danniken wrote in comp.os.linux.misc:
>
>> Thanks Tim.  My reason for trying to do this in the shell (as opposed to
>> in a file manager) is because I have some folders with a lot of files in
>> them (thousands to tens of thousands), and my file manager (Dolphin -
>> KDE) often has problems at times with folders that big.
>>
>> I find that using the shell is a *lot* quicker than the file manager,
>> and very noticeably so when interacting with one of these
>> "high-capacity" folders.
>
> I really meant "are you obsessed with not exec-ing other command binaries"?
> That could be a valid concern on a crappy little embedded system, but not
> usually a problem on a normal system - unless you are trying to aim for 100%
> portability across loads of unices - where you cannot assume GNU extensions
> etc.

Okay, I gotcha.  I'm not at that level (yet), just a home PC user for 
the time being.

Jon

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.os.linux.misc


csiph-web