Skip to content
ggreer edited this page Jan 17, 2012 · 11 revisions

Build

First, you'll need to install the dependencies. In addition to the normal requirements for compiling code, Ag requires PCRE. On Ubuntu, run apt-get install -y libpcre3-dev to install it. OS X has an older version of PCRE which works fine, but is slower. If you want 20% faster searching, install homebrew, then run brew install pcre. You can also build and install PCRE manually. The latest tarballs are here.

Once you've got the dependencies, run ./build.sh to build Ag.

Install

sudo make install

Use

Basic usage of Ag is simple: cd to the directory you want to search and run ag blah to find instances of "blah". You can also run ag blah /some/path if you don't want to cd.

If you want to learn more options, run ag --help for usage or man ag for even more help.

Contribute

If you have

Other stuff you might be interested in

  • Ack - Better than grep
  • AckMate - An ack-powered replacement for TextMate's slow built-in search.
  • ack.vim
  • Exuberant Ctags - Faster than Ag, but it builds an index beforehand. Good for really big codebases.
  • Git-grep - As fast as Ag but only works on git repos.
Clone this wiki locally