|
How to grep / zgrep to output ONLY the matching filename and line number?
Hi all,
I am trying to zgrep / grep list of files so that it displays only the matching filename:line number and does not display the whole line, like:
(echo "1.txt";echo "2.txt") | xargs zgrep -no STRING
If I use -o option, it displays the matching STRING and if not used, displays the whole matching line. I don't want to display the line content. Just the filename and linenumber needs to be displayed.
I am also trying to play around with awk.
Any response will be highly appreciated.
Thanks in advance,
vvaidyan
|