Fedora Linux Support Community & Resources Center
  #1  
Old 1st January 2008, 05:03 PM
bkochis Offline
Registered User
 
Join Date: May 2007
Posts: 72
File content search utility

I have an OsCommerce installation and am adding packages, etceteras at home.

I am looking for a utility that will allow me to search a directory of PHP for files containg a specific string such as 'tep_encrypt_password'. I do no care command-line or GUI.
I seem to be running into a lot of 'undefined' errors and am trying to find out where these items were defined in the unmodified original package or add-ons.

Thanks, Bob
Reply With Quote
  #2  
Old 1st January 2008, 05:49 PM
rbo83 Offline
Registered User
 
Join Date: Apr 2006
Location: Toronto
Posts: 100
Are you familiar with grep ?
Reply With Quote
  #3  
Old 1st January 2008, 05:58 PM
bkochis Offline
Registered User
 
Join Date: May 2007
Posts: 72
not really. Can I grep an entire directory looking for a text phrase? That would be cool.
Reply With Quote
  #4  
Old 1st January 2008, 06:59 PM
mbratch Offline
Registered User
 
Join Date: May 2006
Posts: 268
Do a 'man grep', there's an option to recurse directories.
Code:
grep -r _expression_ _dir_
Here's an equivalent method using 'find':
Code:
find _dir_ -type f -exec grep _expression_ {} \; -print
__________________
Mark Bratcher
http://www.codekinesis.com

Those who don't learn from history are doomed to accept the rewriting of it.
Reply With Quote
  #5  
Old 19th October 2011, 09:28 PM
Fenrin Offline
Registered User
 
Join Date: Apr 2010
Location: Earth
Posts: 894
linuxopera
Re: File content search utility

nice that I found this thread this command "grep -r _expression_ _dir_" is indeed useful. Even though it has some disadvantages compared to eclipses search utility. But nevertheless I prefer geany and this command instead to use slow PHPEclipse.

Does anyone know any other useful search utility to find expressions in textfiles? In gnome 2 was beagle for this purpose right? Any equivalent program in Gnome 3 yet?
Reply With Quote
  #6  
Old 19th October 2011, 10:16 PM
mikereid Offline
Registered User
 
Join Date: Aug 2011
Posts: 60
linuxfirefox
Re: File content search utility

Quote:
Originally Posted by mbratch View Post
Here's an equivalent method using 'find':
Code:
find _dir_ -type f -exec grep _expression_ {} \; -print
And this technique can also be used to search for particular files, or file types. I often find this useful when trying to remember where I wrote some code to do some particular task...

The syntax I'm more familiar with is (for searching down from the current directory):
Code:
grep _expression_ `find . -iname "*._extension_" -print`
And in practise I have the find coded in a shell script so I can type something short, like:
Code:
grep _expression_ `_my_find_script_"*._extension_"`
Mike
Reply With Quote
Reply

Tags
content, file, search, utility

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I see directories ordered by content file size? DennyCrane Using Fedora 2 23rd September 2008 04:17 AM
Bash script - File search output to new file ampapa Using Fedora 12 19th October 2006 01:49 AM
add content to .config file wahaha Servers & Networking 1 27th August 2006 03:23 PM
content of passwd file kuul Using Fedora 5 12th July 2006 08:55 AM


Current GMT-time: 22:24 (Friday, 29-08-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat