Making Better Use of Your .Ackrc File

Many command line utils have a . file that people rarely use. Ack is one of them.

For a project I’m working on, there’s a var folder (ignored in git) where all the logs go. When I perform an ack search, I have no interest in ack looking through the var folder every single time.

By default, ack only checks your ~/.ackrc file for it’s default switches. You can have per directory ack settings if you add this to your .bash_profile:

export ACKRC=".ackrc"

Now you don’t have to worry about random log file being searched every time you try to find something.

new-host-3:dev  jhaddad$ cat .ackrc
--ignore-dir=var/

Just add whatever switches you want, one per line.

If you found this post helpful, please consider sharing to your network. I'm also available to help you be successful with your distributed systems! Please reach out if you're interested in working with me, and I'll be happy to schedule a free one-hour consultation.