LoginSignup
45
45

More than 5 years have passed since last update.

grepやackよりも速いコード検索ツールのagをローカルビルドインストールする

Last updated at Posted at 2013-03-02

今まで自分もackを使ってソースコードのgrepを行なっていましたが、ag (the silver searcher)の速さに感動してこちらに乗り換えました。
元のGitHubのリポジトリは https://github.com/ggreer/the_silver_searcher
$HOME/local以下へのインストール手順は以下のとおり。CentOS5系で動作確認済み。

なぜ早いのかの説明は、
ackを捨てて、より高速なag(The Silver Searcher)に切り替えた
http://blog.glidenote.com/blog/2013/02/28/the-silver-searcher-better-than-ack/
を参照のこと。

$ mkdir -p $HOME/local/source
$ cd $HOME/local/source
$ wget "https://github.com/ggreer/the_silver_searcher/archive/master.zip" --no-check-certificate
$ unzip the_silver_searcher-master.zip
$ cd the_silver_searcher-master
$ sed -i -e "s/configure/configure --prefix=\$HOME\/local/g" build.sh
$ ./build.sh
$ make install

これで~/local/bin/agにインストール完了。使う時は、$HOME/local/bin/にパスを通して

$ ag hogehoge

これで高速に検索できます。しかも見た目はackとおなじように一つのファイルごとにうまくまとめられて表示されます。詳しくはGitHubの元のリポジトリの説明を参考に。
素晴らしい。

45
45
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
45
45