![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| grep string and output filename | happyv | Shell Programming and Scripting | 3 | 11-20-2007 12:16 AM |
| Get Filename and Line Number using grep | ceemh3 | UNIX for Dummies Questions & Answers | 4 | 09-17-2007 11:35 AM |
| Grep Line with Matching Fields | hemangjani | UNIX for Advanced & Expert Users | 13 | 08-10-2007 12:46 PM |
| Grep all files matching partial filename | mharley | Shell Programming and Scripting | 3 | 06-08-2005 03:17 PM |
| Losing filename in grep output | netguy | Shell Programming and Scripting | 6 | 04-27-2004 12:39 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|