Alex Rivera | Logout

Find files containing a given text

Asked 2011-05-27T13:50:29.227
209

In bash I want to return file name (and the path to the file) for every file of type .php|.html|.js containing the case-insensitive string "document.cookie" | "setcookie"

How would I do that?

Edit
Report

1 Answer

5
find . -type f -name '*php' -o -name '*js' -o -name '*html' |\
xargs grep -liE 'document\.cookie|setcookie'
answered 2011-05-27T14:03:35.807

Your Answer