mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-11 21:58:47 +00:00
Update cheatsheets
This commit is contained in:
42
rg
Normal file
42
rg
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# rg
|
||||
|
||||
> Ripgrep is a recursive line-oriented search tool.
|
||||
> Aims to be a faster alternative to `grep`.
|
||||
> More information: <https://github.com/BurntSushi/ripgrep>.
|
||||
|
||||
- Recursively search the current directory for a regular expression:
|
||||
|
||||
`rg {{regular_expression}}`
|
||||
|
||||
- Search for regular expressions recursively in the current directory, including hidden files and files listed in `.gitignore`:
|
||||
|
||||
`rg --no-ignore --hidden {{regular_expression}}`
|
||||
|
||||
- Search for a regular expression only in a subset of directories:
|
||||
|
||||
`rg {{regular_expression}} {{set_of_subdirs}}`
|
||||
|
||||
- Search for a regular expression in files matching a glob (e.g. `README.*`):
|
||||
|
||||
`rg {{regular_expression}} --glob {{glob}}`
|
||||
|
||||
- Search for filenames that match a regular expression:
|
||||
|
||||
`rg --files | rg {{regular_expression}}`
|
||||
|
||||
- Only list matched files (useful when piping to other commands):
|
||||
|
||||
`rg --files-with-matches {{regular_expression}}`
|
||||
|
||||
- Show lines that do not match the given regular expression:
|
||||
|
||||
`rg --invert-match {{regular_expression}}`
|
||||
|
||||
- Search a literal string pattern:
|
||||
|
||||
`rg --fixed-strings -- {{string}}`
|
||||
Reference in New Issue
Block a user