find ~/da -type f -name ‘*.php’ -exec grep -H ‘Main’ {} \;
第一个参数 ~/da 指定目录
-type f 搜索类型为文件
-name 文件名,支持通配符
-exec 结果作为参数给下边的命令执行
-H 输出文件路径
‘Main’ 搜索包含的结尾
{} \; -exec最后总是要加上他……
|
||||||
|
find ~/da -type f -name ‘*.php’ -exec grep -H ‘Main’ {} \; 第一个参数 ~/da 指定目录 |
||||||
|
Copyright © 2010 Symphony 一个人不能没有长进 - All Rights Reserved
|
||||||
Recent Comments