← 返回命令列表

Linux command

pt 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Search for pattern

pt [pattern]

Search in specific directory

pt [pattern] [path]

Search specific file types

pt --type=[go] [pattern]

Case insensitive search

pt -i [pattern]

Show only filenames

pt -l [pattern]

说明

pt (the Platinum Searcher) is a fast code search tool written in Go, similar to ag (The Silver Searcher) and ack. It recursively searches directory trees for text patterns, automatically skipping files listed in .gitignore and other VCS ignore files. The tool is designed for searching source code in large projects. It supports filtering by file type, word-boundary matching, and context display around matches. Being written in Go gives it good cross-platform support with a single static binary.

参数

-i
Case insensitive.
-l
Files only.
--type _TYPE_
File type filter.
-w
Word match.
-C _N_
Context lines.

FAQ

What is the pt command used for?

pt (the Platinum Searcher) is a fast code search tool written in Go, similar to ag (The Silver Searcher) and ack. It recursively searches directory trees for text patterns, automatically skipping files listed in .gitignore and other VCS ignore files. The tool is designed for searching source code in large projects. It supports filtering by file type, word-boundary matching, and context display around matches. Being written in Go gives it good cross-platform support with a single static binary.

How do I run a basic pt example?

Run `pt [pattern]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -i do in pt?

Case insensitive.