How can I grep for a string that begins with a dash/hyphen?

Use:

grep -- -X

Documentation

Related: What does a bare double dash mean? (thanks to nutty about natty).

Leave a Comment