Answer the question
In order to leave comments, you need to log in
How to use the grep command to search for a line only in certain files?
Let's say I want to find a file that has a certain string in it.
I can
grep -r "string" /path
but there are too many files and I know I need a file. ending in .conf
I tried
grep -r "string" /path/*.conf
but it looked for a directory. ending with .conf
Answer the question
In order to leave comments, you need to log in
find . -regex ".*\.conf" -exec grep -f "тут что ищем" {} \;
find . -name 'php.ini' -exec sed -i 's/log_errors = Off/log_errors = On/g' "{}" \;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question