Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Possible Duplicate:
How can I find a file whose name includes a given string, such as “abcde”?

How to find files in terminal that contains the string "foo"?

I tried the following but doesn't work.

find *foo*.*  // any character before or after "foo" of any extension.

I tried googling UNIX or bash wild card but doesn't provide me any useful result.

share|improve this question

marked as duplicate by Mat, manatwork, warl0ck, rahmu, Renan Sep 19 '12 at 11:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Are you looking for files with foo in their name, or files that contain the string foo somewhere in their contents? BTW, there are hundreds of resources on the use of find here and on the Internet. I'm pretty sure you can find your question answered (whether it's file name or file contents) if you search a bit more. –  Mat Sep 19 '12 at 9:00
    
files with "Foo" in the file name. –  KMC Sep 19 '12 at 9:02
3  
I think you could have found this without any effort. find . -name '*foo*' –  ire_and_curses Sep 19 '12 at 9:09
add comment

2 Answers 2

Comment from @ire_and_curses would be almost correct, but it will not find any files like Foo,fOo, ... This would be better in your case:

from find man page:
-iname pattern
     Like -name, but the match is case insensitive.

find <path> -iname '*foo*'
share|improve this answer
add comment

sorry I didn't understand the question. You should try

find . -name '*foo*'

as specified above

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.