Grepping a list of words

Thomas Dickey dickey at
Thu Aug 12 10:47:19 UTC 2010

On Wed, Aug 11, 2010 at 06:00:22PM -0500, Jack L. Stone wrote:
> Kindly appreciate help with how to grep (or similar) a list of words to
> determine if any of them are in a file rather than grepping one word at a
> time.

put the list in a file, and use grep -f

better, use the \< and \> markers on the file's contents and use egrep.

(grep -w option is likely to be buggy when available).

Thomas E. Dickey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list