I want to grep for the string that starts with a dash/hyphen, like -X, in a file, but it’s confusing this as a command line argument.

I’ve tried:

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

10 Answers
10

Leave a Reply

Your email address will not be published. Required fields are marked *