Finding a Pattern Only When It's a Word
One very useful grep option is -w, which tells it to report a line containing the pattern only when the pattern appears as a separate word. This is just like the <
and >
() pattern-matching characters, but a lot easier to type. (Unfortunately, not all versions of grep have -w.)
- TOR