tags:

views:

465

answers:

1

I'm trying to grep multiple extensions within the current and all sub-folders.

grep -i -r -n 'hello' somepath/*.{php,html}

This is only grepping the current folder but not sub-folders.

What would be a good way of doing this?

A: 

One of these:

find '(' -name '*.php' -o -name '*.html' ')' -exec grep -i -n hello {} +
find '(' -name '*.php' -o -name '*.html' ')' -print0 | xargs -0 grep -i -n hello
John Kugelman