Find the answer to your Linux question:
Results 1 to 3 of 3
I used grep everyday. However, is there a parametes to grep an exact word. Let's say there is a word nelso, nels, nelson. If I grep "nels", it will show ...
  1. #1
    Linux Newbie
    Join Date
    Mar 2006
    Posts
    101

    grep exact letters

    I used grep everyday. However, is there a parametes to grep an exact word. Let's say there is a word nelso, nels, nelson. If I grep "nels", it will show the three. Can I do a grep where it wil only display "nels" and not including nelson and nelso?

  2. #2
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    Code:
    grep -w nels ...

  3. #3
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    If you use grep everyday you should have read the man page for it at least once. And especially if you want to know if it provides a facility you need.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...