简体   繁体   English

为'../'打点(点点斜线)

[英]Grepping for '../' (dot dot slash)

I'm trying to search my directory for files that contain ../ with grep -r -n '../' * , but I get lots of false positives. 我正在尝试在我的目录中搜索包含../ with grep -r -n '../' * ,但是我得到了很多误报。 grep is interpreting the period as a wild character, how do I stop this? grep将这个时期解释为一个狂野的角色,我该如何阻止它呢?

Just escape the dots: 只是逃避点:

grep -r -n '\.\./' *

Tested in Cygwin . Cygwin中测试过。 Dot is of course a wildcard in regular expressions . Dot当然是正则表达式中的通配符。

用反斜杠逃脱圆点: \\.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM