开发者

I want to find list of files (under some directory, recursively) in which the string <some_string> is written

what is the开发者_StackOverflow中文版 best way to do this?


grep -R <some_string> <directory>


Another option is:

find . -name "*.cpp" | xargs grep some_string

if you want to restrict the search to particular file patterns or types. With find, you can also specify the maximum depth to search.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜