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 … Read more

How can I get ack to ignore *.orig files?

Now that ack 2.0 is available: –ignore-file=ext:orig , either on command line or .ackrc. It is possible to ignore files by name. To ignore ctags generated files: –ignore-file=is:tags Filters for different uses can be found on documentation.

How to let ack support more filetypes?

On window,add .ackrc file under C:\Documents and Settings\yourname,with content –type-set=aspx=.aspx you can set a type to multi file extension,seperate by “,” –type-set=aspx=.aspx,.ascx Note ack syntax and behaviour has changed significantly with version 2. The equivalent of the above in version 2 would be: –type-set=aspx:ext:aspx,ascx Where the syntax is –type-set TYPE:FILTER:FILTERARGS and FILTER can be any … Read more

ack: Excluding only one directory but keeping all others with the same name

The older versions of ack can only take the folder name, not the folder path. As of version 1.93_02, they’ve added this ability in: 1.93_02 Wed Oct 6 21:39:58 CDT 2010 [ENHANCEMENTS] The –ignore-dir option now can ignore entire paths relative to your current directory. Thanks to Nick Hooey. For example: ack –ignore-dir=t/subsystem/test-data (From betterthangrep.com/Changes) … Read more

error code: 521