0

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".

1 Answer 1

4

asterisk before and after foo:

find . -name "*foo*"
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .