R
R
Rebus2022-04-14 16:53:46
Java
Rebus, 2022-04-14 16:53:46

How to write a query to search for a commented tag in files using grep?

Hello everyone, tell me how to correctly formulate a query specifically for searching for a comment?

find /home -type f -name "*.php" -exec grep -i -H "<!-- noindex -->"

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vadim Dunkin, 2016-09-24
@vadimushka_d

What type of project did you choose? And I figured out when trying to solve this problem that there is not enough memory,

A
Alexander Babushkin, 2022-04-14
@e0m

find /var/www -type f -name "*.html"
Substitute the found in cat
cat $(find /var/www -type f -name "*.html" )
and its output in grep
cat $(find /var /www -type f -name "*.html" ) | grep -i -H "<\!--"
and you missed |
I myself am a teapot) I have been mastering UNIX for a couple of weeks.

X
xibir, 2022-04-14
@xibir

Same as above, but shorter
fgrep -riH /home --include=\*.php "<!--"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question