vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| this may be a dumb question, but I'm drawing a blank: I need to grep for a string across multiple files, and return the filename of the file in which the string used in the grep was found. Grep'ing across several files using wildcards for the filename parameter returns for me the string I'm searching for, but what I actually need is the name of the file that contains the string. Any tips would be greatly appreciated. |
| |||
| mdevenney1@comcast.net wrote: > this may be a dumb question, but I'm drawing a blank: I need to grep > for a string across multiple files, and return the filename of the file > in which the string used in the grep was found. Grep'ing across > several files using wildcards for the filename parameter returns for me > the string I'm searching for, but what I actually need is the name of > the file that contains the string. Any tips would be greatly > appreciated. See the grep(1) "-l" ('ell', not 'one') option: G> l Only the names of files with matching lines are listed (once), G> separated by newlines. If standard input is searched, a path G> name of - is listed. |
| Thread Tools | |
| Display Modes | |
|
|