Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I know how to find strings in a filename that are at the end or the beginning of the line using the asterisk character accordingly. Problem is I can't find a way to find a string anywhere in the filename. So while a command like this:

find -name foo

will only match a file named foo and ones using the asterisk will only match ones at the end or beginning of the filename, I want an expression that will find "foo" in a filename like "foobar".

share|improve this question

1 Answer 1

asterisk before and after foo:

find . -name "*foo*"
share|improve this answer
    
you are a true guru :) –  Ярослав Рахматуллин Oct 26 '12 at 20:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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