linux 中 如何 搜索 指定目录 下 指定文件 的 指定内容

开发时,经常遇到 全局查找某些代码

linux 中 如何 检索 某 目录下指定文件 的 指定内容如下:

//.点为查找当前目录 下 的 所有 *.php 文件里 有 hello 的文件
find . -name "*.php" | xargs grep "hello"

//根目录
find / -name "*.php" | xargs grep "hello"

.

猜你喜欢

转载自www.cnblogs.com/xiangsj/p/9065336.html