Linux在某文件夹下,查找包含某字符串的文件

# find directory -type f -name "*.php" | xargs grep "strings"


directory是要找的文件夹;如果是当前文件夹可以省略

-type f 说明,只找文件

-name "*.php"  表示只找php文件;也可以不写,表示找所有文件

strings是要找的字符串


评论

© ID4710720 | Powered by LOFTER