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

Grep output concerns

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 ".