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