[lug] Find Command

John Karns jkarns at csd.net
Wed Sep 5 16:47:47 MDT 2001


   find /usr -iname ".*read*" -o -iname "*read*"

Adding the "-o" does it for me

----------------------------------------------------------------
John Karns                                        jkarns at csd.net


On Wed, 5 Sep 2001, Hugh Brown said:

> Darn good question.  I was playing around with it and can't seem to get it
> to do both.
>
> If you do the first iname by itself it lists all the .*read* just fine,
> ditto for the second by itself, but -o'ing them together just gives the
> second item listed.  It seems like the shell regex that is passed to iname
> needs to take care of the or'ing of the patterns.
>
> Hugh
>
> "SoloCDM"
> >
> > How is it possible to force the find command to list all files with
> > "read" in the filename, regardless whether they start with a period
> > or not?
> >
> > I already tried the following:
> >
> >    find /usr -iname ".*read*" -iname "*read*" -type f -print





More information about the LUG mailing list