Skip to content

Instantly share code, notes, and snippets.

@gh640
Last active February 15, 2023 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gh640/c2cb562104482852201884f4ad0ce26a to your computer and use it in GitHub Desktop.
Save gh640/c2cb562104482852201884f4ad0ce26a to your computer and use it in GitHub Desktop.
ripgrep コマンドチートシート
# 非表示ファイルを対象に含める
# -., --hidden
rg --hidden git
# マッチしない行を返す
# -v, --invert-match
rg -v 'docker' /var/log/syslog
# マッチした箇所のみを返す
# -o, --only-matching
rg -o 'docker-.*?\.' /var/log/syslog
# マッチ箇所を置換する
# -r, --replace
rg 'たこ' -r 'タコ'
# 大文字・小文字の区別を行わない
# -i, --ignore-case
rg -i deno
# 行番号を出力する(デフォルトで有効)
# -n, --line-number
rg -i node
# 行番号を出力しない
# -N, --no-line-number
rg -i typescript
# 設定ファイル( macOS の場合)
file ~/.config/ripgrep/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment