home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 27.3 Finding Text That Doesn't Match Chapter 27
Searching Through Files
Next: 27.5 Extended Searching for Text with egrep
 

27.4 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 \> (26.4 ) pattern-matching characters, but a lot easier to type. (Unfortunately, not all versions of grep have -w .)

- TOR


Previous: 27.3 Finding Text That Doesn't Match UNIX Power Tools Next: 27.5 Extended Searching for Text with egrep
27.3 Finding Text That Doesn't Match Book Index 27.5 Extended Searching for Text with egrep

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System