Using find

When not using ack, my favorite search tool, you can still exclude SVN folders. Here is an example of me looking for a file:

$ find . -not \( -name .svn -prune \) -name 'EosController*'
./web/models/controllers/EosController.php
./web/models/controllers/EosControllerTest.php

This mode of expression might be better for your scripting needs.

Published by olleolleolle

Olle is a programmer, enjoying sunny Malmö in Sweden.

Join the Conversation

2 Comments

  1. Do you know about the -f and -g options to ack?

    $ ack -f –php

    will list all PHP files, so that

    $ ack -f –php | ack EosController

    will do the same thing as your example above. And, since that was so common, you can do this:

    $ ack -g EosController –php

  2. Thank you very much, Andy! ack's served me so well, even with my rude and coarse mode of expression. The “-g thang” will make my command-line life more comfortable still. Hooray for the explicit “languages understood” documentation on the first page of ack's informative website.

    I was so happy about ack's .ackrc possibilities that I added case-insensitivity and a bunch of ignored directories. Looking at it, it does not seem optimal. Is there an ackish way of ignoring better?

    -i
    –ignore-dir=vendor
    –ignore-dir=extjs
    –ignore-dir=ext-3.1.1
    –ignore-dir=mochikit
    –ignore-dir=jsan
    –ignore-dir=MochiKit
    –ignore-dir=eos_docs

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.