1 |
On 06/06/15 20:09, Alexander Kapshuk wrote: |
2 |
> On Sat, Jun 6, 2015 at 7:45 PM, Joseph <[1]syscon780@×××××.com> wrote: |
3 |
> |
4 |
> I've bunch of php files in many directories and I need to file a |
5 |
> text string in them "Check/Money Order" |
6 |
> I've tried: |
7 |
> find -type f -print0 | xargs -r0 grep -F 'Check/Money Order' |
8 |
> it doesn't work. |
9 |
> What is a better method of searching files? |
10 |
> -- |
11 |
> Joseph |
12 |
> |
13 |
> grep -ls 'Check/Money Order' `du -a | sed '/\.php$/!d;s/.*\t//'` # grep |
14 |
> will complain that the args list is too long if the number of files |
15 |
> found is too great. |
16 |
> Otherwise, this might work for you: |
17 |
> find dir -type f -name \*.php | xargs grep -sl 'Check/Money Order' |
18 |
|
19 |
Thanks, this worked for me, it searches in current and below dir. |
20 |
|
21 |
find -type f -print0 | xargs -r0 grep -F 'Check/Money Order' |
22 |
|
23 |
-- |
24 |
Joseph |