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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grep search for string with a \

Status
Not open for further replies.

mrcuser

Technical User
Aug 26, 2008
22
GB
Hi the string I have to search for is:

_ab2_th2_nc4th2thisdrive\cdrive

but I need to know how to tell grep to ignore the \ but how to do it has escaped me!

 
Hi

If the string is in a file use single quotes and -F

grep -F '_ab2_th2_nc4th2thisdrive\cdrive' filename
 
That's awesome thanks so much, just run that and extracted everything I need.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top