Computing.Net > Forums > Unix > exact word match in unix

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

exact word match in unix

Reply to Message Icon

Name: vijay.goriya
Date: August 8, 2007 at 00:42:55 Pacific
OS: Windows
CPU/Ram: 256
Product: Windows xp
Comment:

Hi,
I am using the command `grep -n -w GE.. filename | cut -d: -f1` for finding the GE.. in the file,but it also selecting the unwanted words like GN..,G.. etc.pls tell me how to find only GE.. in the file.



Sponsored Link
Ads by Google

Response Number 1
Name: James Boothe
Date: August 10, 2007 at 12:07:27 Pacific
Reply:

The period means any single character. You can backslash each period to escape the special meaning of the periods:

grep -n -w 'GE\.\.' filename


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: exact word match in unix

Word count in unix www.computing.net/answers/unix/word-count-in-unix/7143.html

Highlighting words in unix www.computing.net/answers/unix/highlighting-words-in-unix/4592.html

Tips in creating files in UNIX www.computing.net/answers/unix/tips-in-creating-files-in-unix/7477.html