以递归方式在文件中查找字符串/正则表达式匹配的最佳方式是什么? (UNIX) [英] What's the best way to find a string/regex match in files recursively? (UNIX)
本文介绍了以递归方式在文件中查找字符串/正则表达式匹配的最佳方式是什么? (UNIX)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我记得使用xargs和grep in在一起过去要做到这一点,但我想知道是否有更简单的方法。
grep -r REGEX。
将。
替换为您想要的任何目录搜索。
I have had to do this several times, usually when trying to find in what files a variable or a function is used.
I remember using xargs with grep in the past to do this, but I am wondering if there are any easier ways.
解决方案
grep -r REGEX .
Replace .
with whatever directory you want to search from.
这篇关于以递归方式在文件中查找字符串/正则表达式匹配的最佳方式是什么? (UNIX)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文