开发者

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

开发者 https://www.devze.com 2022-12-22 14:54 出处:网络
what is the开发者_StackOverflow中文版 best way to do this?grep -R <some_string> <directory>Another option is:

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

精彩评论

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