|
|
|
|
 关于grep的用法 - JohnWu [ 2006-07-30 17:48 | 161 byte(s)]
 Re: 关于grep的用法 - yanggl [ 2006-07-31 16:39 | 34 byte(s)]
 Re: 关于grep的用法 - JohnWu [ 2006-07-31 20:11 | 102 byte(s)]
 Re: 关于grep的用法 - r00t [ 2006-07-30 18:08 | 57 byte(s)]
 Re: 关于grep的用法 - JohnWu [ 2006-07-30 20:28 | 46 byte(s)]
 Re: 关于grep的用法 - r00t [ 2006-07-30 20:44 | 211 byte(s)]
 Re: 关于grep的用法 - JohnWu [ 2006-07-30 22:34 | 84 byte(s)]
 Re: 关于grep的用法 - r00t [ 2006-07-30 23:13 | 88 byte(s)]
 Re: 关于grep的用法 - JohnWu [ 2006-07-31 10:11 | 75 byte(s)]
 UNIX下有很多特别伟大的工具,比如find,比如grep,比如awk,比如sed - r00t [ 2006-07-31 10:34 | 42 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
我希望同时grep某个目录和这个目录下面的所有子目录。
但 grep -i "strs" ./dir1/* 只对顶层目录有效,对下面的子目录无效。
请问应该怎样做?
|
|
|
----
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
"."指的是当前目录,可以替换为任何的目录,相对路径或者绝对路径都可以,比如"/",或者"/usr/include"等等
xargs是用来展开find获得的结果,使其作为grep的参数。
|
|
|
----
|
|
[Original]
[Print]
[Top]
|
|
|