Page 1 of 1

How to find a file with a string in it?

Posted: Fri May 15, 2015 2:55 am
by harsini
Hi everybody.
How can I find a file with a specific string in it?I searched web but non of the command work in OpenWRT world e.g.:
find . -iname '*php' | xargs grep 'string' -sl
or grep -R. :roll:

Re: How to find a file with a string in it?

Posted: Fri May 15, 2015 5:09 am
by ispyisail

Re: How to find a file with a string in it?

Posted: Fri May 15, 2015 9:50 am
by harsini

I think I should search within a path not on whole device.Because I tried to use grep and other similar commands to search a file with a string in whole device and that was unsuccessful .
Thanks

Re: How to find a file with a string in it?

Posted: Sun Nov 01, 2015 10:14 am
by oliver
harsini wrote:Hi everybody.
How can I find a file with a specific string in it?I searched web but non of the command work in OpenWRT world e.g.:
find . -iname '*php' | xargs grep 'string' -sl
or grep -R. :roll:

Code: Select all

find . -type f -iname '*php' -exec grep -li 'string' {} \;