1、

find / -name "*" | xargs grep "route"

根文件夹下查找含有关键字route文件,列出文件名route所在行

2、

find / -name "*.txt" | xargs grep "route"

根文件夹下查找后缀名为txt含有关键字route文件,列出文件名route所在行

3、

grep -r "route" /

在根目录下查找含有字符串"route"的文件,输出文件名和匹配行

相关文章: