  | |  | About grep | About grep 2004-01-13 - By Rus Foster
Back > My personal favorite is still:
>
> find . -type f -exec grep 'abc ' {} /dev/null \;
>
> Note the use of /dev/null as a second file name arg to grep:
> this forces grep to emit the name of the file the search string was
> found in, if any...without it you get a list of the matched lines, but
> no file name where found...useless.
A handy varient to find the file in which the pattern was found is
find . -type f -exec grep -l 'abc ' {} \;
Rgds
rus
--
e: support@(protected)
t: 1-888-327-6330
www.jvds.com - Root on your own box
www.vpscolo.com - Your next hosting company
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
|
|
 |