Linux: find a string in PHP files

find . -name "*.php" -exec grep -H "\.cartel.nl" {} \; | grep -v "cav.cartel.nl" >> bart.txt
nice find . -iregex ".*\(html\|php\|js\)" -exec grep -H "search value" {} \; >> bart.txt

-H -n display filename and line number
-v print inverts the match; that is, it matches only those lines that do not contain the given word


Leave a Reply