#author("2019-11-22T23:20:30+00:00","","")
#author("2019-11-30T13:43:31+00:00","","")
#topicpath


///////////////////////////////////////////////////////////////////////////////
* 目次 [#p63d201f]
#contents();

///////////////////////////////////////////////////////////////////////////////
* ripgrep [#qf8f4cb3]
- ripgrep は、grep の高速な代替コマンド。

///////////////////////////////////////////////////////////////////////////////
* build [#pba858da]
- debian9 にはパッケージがないので、使うのであればビルドする必要がある。
- build には cargo (The Rust package manager) が必要なので、入ってない場合は入れる。
 # apt-get install cargo
+ ソースコードの取得
 $ git clone https://github.com/BurntSushi/ripgrep.git
 $ cd ripgrep
 $ git co refs/tags/0.9.0
+ README.md の記載に従いビルドする
 $ cargo build --release
+ ビルド出来たか確認する
 $ ./target/release/rg --version
+ ビルドして出来たコマンドの場所に環境変数 PATH を通すか、コマンドファイルを PATH の通っているところに移す。

///////////////////////////////////////////////////////////////////////////////
* grep とのオプション比較 [#r53574b8]
|~option (ripgrep) |~option (grep) |~description                                         |
|<pattern>         |<pattern>      |match or unmatch pattern                             |
|-e <pattern>      |-e <pattern>   |<pattern> をパターンとして指定する(POSIXに準拠)    |
|-f <file>         |-f <file>      |パターンを <file> から1行を1パターンとして読み込む   |
|-H                |-H             |検索結果にファイル名を付加する                       |
|-h                |--help         |ヘルプを表示                                         |
|--no-filename     |-h             |検索結果にファイル名を付加しない                     |
|-i <file-path>    |-i <file-path> |<file-path> で指定されたファイルを検索対象から除く   |
|-n                |-n             |検索結果に行番号を付加する                           |
|-N                |               |検索結果に行番号を付加しない                         |
|-q                |-q             |標準出力に何も出力しない                             |
|-t <TYPE>         |               |ファイルタイプが<TYPE> のものを検索対象にする        |
|-v                |-v             |<pattern> で指定された文字列を含まないものを検索する |



///////////////////////////////////////////////////////////////////////////////
* 参考リンク [#k9d53c87]
- [[新世代grep 'ripgrep' - エクセレンス★ブログ>https://www.excellence-blog.com/2019/05/10/%E6%96%B0%E4%B8%96%E4%BB%A3grep-ripgrep/]]
- [[第579回 高速で便利なgrep「ripgrep」を活用する:Ubuntu Weekly Recipe|gihyo.jp … 技術評論社>https://gihyo.jp/admin/serial/01/ubuntu-recipe/0579]]
- [[ripgrep.el>http://emacs.rubikitch.com/ripgrep/]]


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS