LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-13-2008, 12:00 PM   #1
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, (Which Exit LOL), USA
Distribution: Centos 6.7 Under VMware in Win7
Posts: 461

Rep: Reputation: 34
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
 
Old 02-13-2008, 01:07 PM   #2
mtimbro
Member
 
Registered: Feb 2008
Location: Montreal, Canada
Distribution: RedHat 3/4, Ubuntu 7.10
Posts: 86

Rep: Reputation: 15
Wink 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.

Last edited by mtimbro; 02-13-2008 at 01:09 PM.
 
Old 02-13-2008, 01:26 PM   #3
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, (Which Exit LOL), USA
Distribution: Centos 6.7 Under VMware in Win7
Posts: 461

Original Poster
Rep: Reputation: 34
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find/grep command to find matching files, print filename, then print matching content stefanlasiewski Programming 9 06-30-2016 05:30 PM
Find command RajRed Linux - Newbie 2 02-11-2006 11:08 PM
question on "find" command jcosenzo Linux - General 1 04-18-2005 02:39 PM
Question on find command rytrom Linux - Newbie 3 08-07-2003 02:14 AM
Find Command - Basic Question tlb04 Linux - General 3 05-06-2003 08:45 PM


All times are GMT -5. The time now is 04:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration