views:

38

answers:

4

right now, all I know to use is: find / -name string.*

that is case sensitive and it won't find files named:

1string.x STRing.x string1.x

How can I search so that all the above would be returned in the search?

+2  A: 

Use the -iname option instead of -name.

llasram
what about the characters before and after the string? will -iname return names with extra characters?
Captain Claptrap
@micah: If you tell it to. `find . -iname '*string*'`
Daenyth
Ok, but `-iname` is not a Posix find option. Posix does specify shell pattern matching for `-name`.
DigitalRoss
@DigitalRoss The original poster specified the 'linux' tag, so I think assuming the GNU findutils is reasonable.
llasram
+1  A: 

Use -iname in find for case insensitive file name matches.

Petesh
A: 

Or you could use find / | grep -i string

DigitalRoss
`find` does this natively. Creating another process just to do that is going to make it slower.
Daenyth
True but it's easy to remember and consistent with the software tools pattern. Find does do shell globbing on plain old `-name`, it is true.
DigitalRoss
A: 

This works as well, if you want to avoid the single quotes:

find . -iname \*string\*
JustinShoffstall