I have a grep output, let's say grep -rn . -e 'potato'
: it lists every line in the pattern filename:line_number:line_content
such that the word 'potato' appears. Below is our delicious output sample:
./recipes/potato_puree.txt:8:- 5 medium-size potatoes.
./recipes/potato_puree.txt:30:- Cook the potatoes for 30 minutes.
./recipes/potato_puree.txt:5:6 medium-size potatoes.
./recipes/fried_potato.txt:10:- Peel the potato;
./recipes/fried_potato.txt:11:- Cut it into sticks;
./items/restaurant.txt:30:- 10kg English potatoes.
./items/grocery.txt:31:- 10kg sweet potatoes.
So far so good! In case I want those lines with the token item
, I pipe the command | grep item
and obtain the output below:
./items/restaurant.txt:30:- 10kg English potatoes.
./items/grocery.txt:31:- 10kg sweet potatoes.
I wish to obtain those WITHOUT token item
on its filename. I thank you in advance for any provided help.
Best regards.