August 23rd, 2013, 01:43 PM
Finding a string
I would like to find a string and the file where the string belongs to in Unix. From a command line, I typed,
cat *.pc | grep "this string"
It returns the string but it does not tell me in which file the string belongs to.
How would you do?
August 24th, 2013, 06:40 AM
The man pages are your friend:
grep -l "this string" *.pc
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
August 26th, 2013, 01:29 PM