Search for hook implementations with grep

Benjamin Melançon's picture
Submitted by Benjamin Melançon on 2010, July 28 - 09:00
  • grep "_form_alter" $(find . -name '*.module' -or -name '*.inc' -or -name '*.php')

    The dot represents the current directory. Find works recursively (searches nested directories) by default. "_form_alter" can be the _something from any hook_something (or, of course, any text).

    Usually a debugger is a better way to find all what a hook invocation actually calls.

    Shell line adapted from http://benbuckman.net/node/6277/s5

  • Book element

  • Tip