2025-03-14 21:59:59 -06:00
|
|
|
# pt
|
|
|
|
|
|
|
|
|
|
> Platinum Searcher.
|
|
|
|
|
> A code search tool similar to `ag`.
|
|
|
|
|
> More information: <https://github.com/monochromegane/the_platinum_searcher>.
|
|
|
|
|
|
|
|
|
|
- Find files containing "foo" and print the files with highlighted matches:
|
|
|
|
|
|
|
|
|
|
`pt {{foo}}`
|
|
|
|
|
|
|
|
|
|
- Find files containing "foo" and display count of matches in each file:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`pt {{[-c|--count]}} {{foo}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Find files containing "foo" as a whole word and ignore its case:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`pt {{[-wi|--word-regexp --ignore-case]}} {{foo}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Find "foo" in files with a given extension using a regular expression:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`pt {{[-G|--file-search-regexp]}}='{{\.bar$}}' {{foo}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Find files whose contents match the regular expression, up to 2 directories deep:
|
|
|
|
|
|
|
|
|
|
`pt --depth={{2}} -e '{{^ba[rz]*$}}'`
|