A
A
Alexv012015-06-25 06:43:35
linux
Alexv01, 2015-06-25 06:43:35

How to make search for occurrence of text with recursion in grep in certain extensions?

Tell me how to do a recursive grep search in all directories so that it checks only *.php files?


grep -rl "some-words" "*.php$"
grep: *.php$: No such file or directory

it turns out to run grep either only with recursion, but without expansion restriction or without recursion, but with expansion

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2015-06-25
@Alexv01

grep -r --include=*.php "some-words" /path

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question