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 wild card?

Status
Not open for further replies.

gawker

Programmer
Feb 21, 2002
34
US
In a file, I have strings such as:

abc_1234_xyx
abc_34kk_xyx
abc_q3_xyx

I am trying to find a wild card pattern I can use so that a single grep can find strings with abc at the start and xyx at the end. The string length may vary.

I was hoping there was something like grep "abc*xyz" where "*" tell grep to match anything in the middle.

Thank you!

Gawker
 
grep '^abc.*xyx$'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top