How do I grep for a greater than symbol?

Drew LeSueur picture Drew LeSueur · Apr 5, 2013 · Viewed 11.2k times · Source

I am trying to grep for a php function call

grep -Ri '->someFunction' .

But it's not working. What am I doing wrong?

Answer

Gilles Quenot picture Gilles Quenot · Apr 5, 2013

It's not the quotes : try this :

grep -Ri -- '->someFunction' .

the -- part stands for end of options ; it's a shell trick.