0

I am trying to extract a pattern using grep -r. It works, except the name of the directory also gets printed out. I just need it to print out the patterns it finds instead of including the path to the pattern.

Code:

grep -r <pattern> */<file_name_pattern>

Results:

<path_to_pattern>:<pattern_result>
<path_to_pattern>:<pattern_result>
<path_to_pattern>:<pattern_result>
... etc

I just want:

<pattern_result>
<pattern_result>
<pattern_result>
...etc
Luther_Blissett
  • 327
  • 1
  • 6
  • 16

0 Answers0