Suppose I have many files in the form
First Line Name Second Line Surname Adress Third Line etc etc
Now I use grep to match the first line. But I do this to find the second line. The second line is not a pattern that can be matched (it just depends on the first line). My regex pattern works, and the command I use is
grep -rHIin pattern . -A 1 -m 1
The -A option now prints the line after the match . The -m stops after 1 match (because there is another line that matches my pattern, but I'm only interested in the first match ...)
It really works, but the result is this:
./example_file:1: First Line Name ./example_file-2- Second Line Surname Adress
I read the manual, but could not understand any information or information about this. Now here is the question.
How can I suppress a match ? The output should be in the form:
./example_file-2- Second Line Surname Adress
source share