Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grep for exact string

Status
Not open for further replies.

TSch

Technical User
Jul 12, 2001
557
DE
Hi folks,

I have a list containing several server names.

Like this:

servio1
servio2
rzvio1
rzvio2
brzvio1
brzvio2

Now I'd like to search this list for the server "rzvio1"

If I use grep it gives me rzvio1 as well as brzvio1 ...

Is there any way to perform a grep for an exact string so that it will only return rzvio1 as search output?

Regards
Thomas
 
oops, found it !

grep -w

:)

 
Also, if this is the first column in your file, I think the following should also work
Code:
grep ^rzvio1 filename
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top