Live Chat!

Matching Whole Word in Grep

1 votos Vota!!

November 7th, 2006 liewsheng Posted in Text Manipulation, grep | Hits: 14129 |

Is “grep” capable to match a whole word? The answer of cause is yes!!

grep -w "keyword" filename

this will only display the line with matching word. Using the file contents in previous example, if this command enter:

grep -w "ates" filename 

you will get:

ates, 953645

Leave a Reply

Security Code: