Skip to content

af search

Search main's files with a regular expression

Prints each matching line as path:line:text, searching only the files you may read. ^ and $ match at the start and end of each line. With only –file, prints the paths that match it.

Usage

af search [OPTIONS] [PATTERN]

Arguments

  • [PATTERN]

    Regular expression to search for, in Rust regex syntax

Options

  • -f, --file <FILE>

    Search only files whose path matches this regular expression

  • -n, --limit <LIMIT>

    Maximum number of files to return

    Default: 20

  • --lines <LINES>

    Maximum number of matching lines to return from each file

    Default: 20

Global options

Every af command also takes the global options.

Examples

af search 'fn main'                  Lines matching `fn main` in any file
af search 'TODO' -f '\.rs$'          Lines matching `TODO` in Rust files
af search -f '(^|/)Cargo\.toml$'     Paths of all Cargo.toml files

Type to search…

↑↓ navigate↵ selectEsc close