grep在GNOME桌面(Linux)中返回错误的消息


0

我需要搜索文件夹结构中的特定字符串。

文件系统包含多个文件,但我只需要检查XML文件。

我搜索并尝试了Linux递归搜索的命令,但它没有用。我从命令得到以下输出

$ grep -rio --include=*.xml "invokeAction" .
grep: No match.
$ grep -riwc "invokeAction" *
grep: <.Lists all the file Names recursively.>: No such file or directory
$ grep -ir invokeAction *.xml
grep: <.Lists all the file Names.>: No such file or directory

请帮忙。

我需要搜索

String: "invokeAction"
Mode: Word Only
Directory: Current Directory Recursively 

Answers:


0

这将从路径中递归搜索所有python文件(* .py)并在每个文件上运行grep -l import

find /path/To/Seach -iname \*.py -exec grep -l import {} \;

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.