Reputation: 1617
I'm trying to search my directory for files that contain ../
with grep -r -n '../' *
, but I get lots of false positives. grep
is interpreting the period as a wild character, how do I stop this?
Upvotes: 8
Views: 9235
Reputation: 43198
Just escape the dots:
grep -r -n '\.\./' *
Tested in Cygwin. Dot is of course a wildcard in regular expressions.
Upvotes: 17