search for a specific file type with ack

Use –type for this. To only search python files for example:

ack --type=python searchthis

List all the supported types with

ack --help=types  # ack 2.x
ack --help-types  # ack 3.x.x

If you want to create a custom type, add something like this to ~/.ackrc:

--type-add=custom:ext:rb
--type-set

Then you can use –type=custom with ack to just search file with the .rb extension.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)