1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-04 02:35:32 +02:00

rg: Add example for searching filenames (#9856)

* rg: Add example for searching filenames

* Reduce to 8 commands
This commit is contained in:
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

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}}`