What's the best way to find a string/regex match in files recursively? (UNIX)

前端 未结 8 1366

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 t

相关标签:
8条回答
  • If you're looking for a string match, use

    fgrep -r pattern .
    

    which is faster than using grep. More about the subject here: http://www.mkssoftware.com/docs/man1/grep.1.asp

    0 讨论(0)
  • 2020-12-29 22:45
    grep -r REGEX .
    

    Replace . with whatever directory you want to search from.

    0 讨论(0)
提交回复
热议问题