A search tool like grep, optimized for programmers.

# To find files containing "foo":
ack <foo>

# To find files of a specific type:
ack --ruby <foo>

# To count the total number of matches for the term "foo":
ack -ch <foo>

# To show the file names containing "foo" and number of matches in each file:
ack -cl <foo>

# To search a file for a specified string:
ack bar "foo bar" <path/to/file>

# To search a file for the specified regex pattern:
ack bar "[bB]ar \d+" <path/to/file>

# To list all valid types:
ack --help=types