ack

ack

TLDR

Find files containing "foo"

$ ack [foo]
copy

Find files of a specific type

$ ack --ruby [foo]
copy

Count the total number of matches for the term "foo"

$ ack -ch [foo]
copy

Show the file names containing "foo" and number of matches in each file

$ ack -cl [foo]
copy

Search a file for a specified string

$ ack bar "[foo bar]" [path/to/file]
copy

Search a file for the specified regex pattern

$ ack bar "[[bB]ar \d+]" [path/to/file]
copy

List all valid types

$ ack --help-types
copy

Copied to clipboard
free 100$ digital ocean credit