Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    c q
    c q is offline
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mumbai, India
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tool to search strings in a folder full of php files?

    Hello,
    I am trying to implement moodle on my intranet... but facing a lot of problems fine-tuning it to my needs... even simple things like hcanging the headings is a real head ache cuz i just cant find exactly which file is causing a particular heading to appear the way it does.

    is anyone aware of any tool/software that'll help me search for a string WITHIN the php code of multiple files?

    thanks in advance
    - cq
    It's a new world. It's a new day.
    www.nehasaxena.com : : www.kohimaorphanage.org

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    if it's a linux machine, then 'grep' is what you want.
    To search for 'foo' in all files in a folder, you'd do (from a command-line):
    Code:
    grep foo *
    to include subfolders as well (do the search recursively):
    Code:
    grep foo * -r

    If you want to do the replaces in one go (will replace 'foo' with 'bar' in all php files):
    Code:
    find -name "*.php" -exec sed -i s/foo/bar/g {} ;
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com

  • #3
    c q
    c q is offline
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mumbai, India
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts
    umm... no... windows it is
    It's a new world. It's a new day.
    www.nehasaxena.com : : www.kohimaorphanage.org

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Grep is great... for Windows try the free utility Agent Ransack.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •