Skip to main content
edited title
Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238

Grep Help output concerns

edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265
Source Link

Grep Help output

Okay so I'm using grep on a external HDD

example,

M:/

grep -rhI "bananas" . > out.txt

which would output any lines within " M:/ " containing " bananas "

However I would like to output the entire contents of the file, so if one line in example.txt contains " bananas " output entire content of example.txt and same goes for any other .txt file within directory " M:/ " that contains " bananas ".