Skip to main content
1 of 3

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