2018-08-17 11:24:45 +01:00
|
|
|
# pt
|
|
|
|
|
|
|
|
> Platinum Searcher.
|
|
|
|
> A code search tool similar to `ag`.
|
2019-05-29 14:53:56 +01:00
|
|
|
> More information: <https://github.com/monochromegane/the_platinum_searcher>.
|
2018-08-17 11:24:45 +01:00
|
|
|
|
|
|
|
- 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:
|
|
|
|
|
|
|
|
`pt -c {{foo}}`
|
|
|
|
|
|
|
|
- Find files containing "foo" as a whole word and ignore its case:
|
|
|
|
|
|
|
|
`pt -wi {{foo}}`
|
|
|
|
|
|
|
|
- Find "foo" in files with a given extension using a regular expression:
|
|
|
|
|
|
|
|
`pt -G='{{\.bar$}}' {{foo}}`
|
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
- Find files whose contents match the regular expression, up to 2 directories deep:
|
2018-08-17 11:24:45 +01:00
|
|
|
|
|
|
|
`pt --depth={{2}} -e '{{^ba[rz]*$}}'`
|