My linux server has a folder with all html files. I am trying to find files (names and line numbers) using the below command:
grep -rnw '/myfolder/' -e '</tr> <footer class="final-footer">'
I know several files that contain this pattern (with a strict single space in between the </tr>
and <footer class="final-footer">
). However, the grep command is returning nothing.
When I search just for '<footer class="final-footer">
' (without </tr>
and the following single space) the grep returns correctly.
grep -rnw '/myfolder/' -e '<footer class="final-footer">'
I tried the above command just to check if my grep syntax is correct. But my specific requirement is to execute the first command. How exactly to do that?
Additional Info
A sample of the pattern in one of the files is this: ....International, Inc.</td></tr> <footer class="final-footer">
...
-w
flag... it will add word boundary condition and perhaps there are word characters before</tr>
... adding sample input (2-3 lines including the line to be matched) would help in testing.. – Sundeep