LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fgrep or find command question. (https://www.linuxquestions.org/questions/linux-newbie-8/fgrep-or-find-command-question-620865/)

swamprat 02-13-2008 12:00 PM

fgrep or find command question.
 
Hello all,

I want to find a string of characters any where in the system but I don't want the command(s) to bother looking a binary files. The string I'm looking for is more then likely in a plain text file.

What would the basic command look like, I tried this and it's taking forever:

fgreg -r string * (I'm searching from the root down) I don't know how I would set up a find command because I'm not looking for a file, just a the string of characters.

Any help will be apperciated.

Thanks

mtimbro 02-13-2008 01:07 PM

find
 
You can also do this:

find / | xargs grep 'string'

But keep in mind that you are looking for a string system-wide, thus there are no time-friendly commands to help you go through this process...

Cheers.

swamprat 02-13-2008 01:26 PM

Thanks for your reply.

I really don't know if my commands worked, maybe I didn't give it time enough to go throught the entire system, I'm going to try your solution.

BTW, one of the folks here in the office did find this command combinition and I'm going to also try that.

find / -type f -exec grep -l STRING {} \;

This also seems similar to my first command.

Thanks again.


All times are GMT -5. The time now is 06:14 PM.