LinuxCommandLibrary

pt

Fast source code search tool in Go

TLDR

Search for pattern

$ pt [pattern]
copy
Search in specific directory
$ pt [pattern] [path]
copy
Search specific file types
$ pt --type=[go] [pattern]
copy
Case insensitive search
$ pt -i [pattern]
copy
Show only filenames
$ pt -l [pattern]
copy

SYNOPSIS

pt [options] pattern [path]

DESCRIPTION

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.

PARAMETERS

PATTERN

Search pattern.
PATH
Search path.
-i
Case insensitive.
-l
Files only.
--type TYPE
File type filter.
-w
Word match.
-C N
Context lines.

CAVEATS

Written in Go. Respects .gitignore.

HISTORY

pt was created as a fast code search tool written in Go.

SEE ALSO

ag(1), rg(1), grep(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community