rg: Add example for searching filenames (#9856)

* rg: Add example for searching filenames

* Reduce to 8 commands
pull/6/head
IngridMorstrad 2023-02-20 22:53:19 -08:00 committed by GitHub
parent cf0e914f0c
commit 3d77e1a35c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -12,10 +12,6 @@
`rg --no-ignore --hidden {{regular_expression}}`
- Search for a regular expression only in a certain filetype (e.g. HTML, CSS, etc.):
`rg --type {{filetype}} {{regular_expression}}`
- Search for a regular expression only in a subset of directories:
`rg {{regular_expression}} {{set_of_subdirs}}`
@ -24,6 +20,10 @@
`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}}`