@ 201216.1raw
current

ag(1) – The Silver Searcher. Like ack, but faster.

SYNOPSIS

ag [options] pattern [path …]

DESCRIPTION

Recursively search for PATTERN in PATH. Like grep or ack, but faster.

OPTIONS

FILE TYPES

It is possible to restrict the types of files searched. For example, passing --html will search only files with the extensions htm, html, shtml or xhtml. For a list of supported types, run ag --list-file-types.

IGNORING FILES

By default, ag will ignore files whose names match patterns in .gitignore, .hgignore, or .ignore. These files can be anywhere in the directories being searched. Binary files are ignored by default as well. Finally, ag looks in $HOME/.agignore for ignore patterns.

If you want to ignore .gitignore and .hgignore, but still take .ignore into account, use -U.

Use the -t option to search all text files; -a to search all files; and -u to search all, including hidden files.

EXAMPLES

ag printf: Find matches for “printf” in the current directory.

ag foo /bar/: Find matches for “foo” in path /bar/.

ag -- --foo: Find matches for “–foo” in the current directory. (As with most UNIX command line utilities, “–” is used to signify that the remaining arguments should not be treated as options.)

ABOUT

ag was originally created by Geoff Greer. More information (and the latest release) can be found at http://geoff.greer.fm/ag

SEE ALSO

grep(1)