Grepping for string containing dash

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-03-11T19:14:42Z Indexed on 2010/03/11 19:19 UTC
Read the original article Hit count: 181

Filed under:
|
|

I want to grep for the string "-X" in a file but it's confusing this as a command line argument.

I've tried

grep "-X"
grep \-X
grep '-X'

© Stack Overflow or respective owner

Related posts about unix

Related posts about grep