Is there a way to make grep output \"words\" from files that match the search expression?
If I want to find all the instances of, say, \"th\" in a number of files, I
You can also try pcregrep. There is also a -w option in grep, but in some cases it doesn't work as expected.
-w
From Wikipedia:
cat fruitlist.txt apple apples pineapple apple- apple-fruit fruit-apple grep -w apple fruitlist.txt apple apple- apple-fruit fruit-apple