-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Home
ggreer edited this page Jan 17, 2012
·
11 revisions
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.
sudo make install
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.
If you have
- 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.