There is no need to pipe to grep
.
find . -type f -name "*dan*" \( -path '*?html*' -o -path '*?php*' \)
Your grep '.html'
would match html
preceded with any character (as .
in regex matches any character) anywhere in a line, this is why I used -path '*?html*'
that does the same thing for pathnames used by find
. Maybe this is what you meant, or maybe you really wanted the following:
find . -type f -name "*dan*" \( -name '*.html' -o -name '*.php' \)
where -name '*.html'
matches literal.html
(the dot is not special) at the end of filename.