How do I grep for an exact word as with "grep -w" in Linux? Added: 09/12/03
From 11.11 onwards, the -w option is supported. Otherwise, use:
$ grep -E "(^|[^[:alnum:]_])(<word_to_be_searched>)([^[:alnum:]_]|$)"
or install GNU grep and use its -w option.
Home | FAQ |