linux find 文件夹下查找字符串

1、

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

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

2、

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

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

3、

grep -r "route" /

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

posted @ 2012-09-23 15:43  helloweworld  阅读(1787)  评论(0编辑  收藏  举报