Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Rep:
Quote:
Originally Posted by TBotNik
All,
I'm not very good at using cmd line to find strings in a file, normally using kfind, but not installable on the current box, so needing the right locate or find cmd to find files in a framework containing db queries so need to find the strings:
Code:
->query
or
->qry
using either the locate or find cmdline dmds.
Assuming search filtering should be using REGEX!
Searsh will be system wide using '*.php' and the subdirectory '/EM/'.
I realize this is an older thread, but the OP hasn't marked it as solved so I'll provide another solution as an alternative to rnturn's.
Quote:
Searsh[sic] will be system wide using '*.php' and the subdirectory '/EM/'.
This statement is confusing, by the way.
Solution #1:
Code:
# cd into the EV directory
cd EV
# use a combination of grep's recursive option and its "include file" filter.
# include '>' in the search pattern to ensure only methods are matched.
grep -R --include '*.php' -E '>(query|qry)'
I realize this is an older thread, but the OP hasn't marked it as solved so I'll provide another solution as an alternative to rnturn's.
This statement is confusing, by the way.
Solution #1:
Code:
# cd into the EV directory
cd EV
# use a combination of grep's recursive option and its "include file" filter.
# include '>' in the search pattern to ensure only methods are matched.
grep -R --include '*.php' -E '>(query|qry)'
Solution #2:
Code:
grep -R --include '*.php' -E '>(query|qry)' EV/
individual,
Getting the info correct I'm working with:
Code:
cd /path/EM
grep -R --include '*.php' -E '>(dbFetch|dbArray)' > /home/files/emdbqry_dump.txt
or
grep -R --include '*/EM/*.php' -E '>(dbFetch|dbArray)' > /home/files/emdbqry_dump.txt
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.