News for hackers. Stuff that matters.
Re:Ack - better than grep, a power search tool for programmers by _sh on Thursday December 03, 2009 @10:49PM (#975758)
A nice alternative to my decidedly low-tech approach:

  (in ~/.zshrc)
  # 'ff' command -- find string in files with a specified suffix
  ff() {
    [[ -n $1 && -n $2 ]] || {
      echo "Usage $0 [suffix] [string]"
      echo "Where"
      echo "  suffix  file suffix (without wildcards)"
      echo "  string  string to search for (quote if spaces)"
      return
    }
    find . -name \*$1 -exec grep -Hn $2 "{}" \; | less -RFX
  }
Has colorized output, and only pages (with less) when there is more than one page to show.

There are no comments on this comment yet.