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 string? 1

Status
Not open for further replies.

SpongeBob1

Programmer
Mar 1, 2002
49
US
Hi,

Does anyone know the command to grep for a string?

Thanks.
 
[tt]grep string [ file ... ][/tt]
eg:
[tt]grep xyz a b c[/tt]
Will search for string 'xyz' in files a, b, and c
Cheers, Neil
 
But if you've space(s) in the search string, then you
must use quotes - singles or doubles - either's OK
and a \ in front of any characters that are meaningful to the shell - like $ or . or /
eg grep "Town Centre" infile
and grep "exec\.bat" infile

Cheers
DickieBird Dickie Bird
db@dickiebird.freeserve.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top