I want to grep
for the string that contains with dashes like this:
---0 [58ms, 100%, 100%]
There's at least one dash.
I found this question: How can I grep for a string that begins with a dash/hyphen?
So I want to use:
grep -- -+ test.txt
But I get nothing.
Finally, my colleague tells me that this will work:
grep '\-\+' test.txt
Yes, it works. But neither he nor I don't know why after searched many documents.
This also works:
grep -- -* test.txt