I was introduced to
ack by Xavi Noria several years ago. I liked the usability of the tool but I was so accustomed to find and grep that I never got around to learning it. This post is the perfect excuse to change that and learn ack.
While doing my initial
ack research I discovered that there's been an onslaught of new search command line tools in the last few years—focusing in both usability and speed. If you're interested in knowing more about the rest of the tools I will just name a few:
grep -r <string> | grep.
The smart case search feature requires some detailed explanation:
ag trusty will search for any reference to trusty: Trusty, TRUSTy, trusty, TrusTy and so on
ag Trusty will search and output only references to
ag TRUSTY this is the same as the previous example.
If you wish to perform strict case insensitive (for lowercase) queries, you just need to use the
Basic search, search for all instances of
require in your current repo:
Filter by file extension or file name (using
ag -G .markdown dnsimple
Regular expresion search:
Search compressed files using -z flag:
ag -z -G .zip packed
It parses from stdin (as any good UNIX tool should):
ag --help | ag search
You can learn more about
ag in its official github repository.
Devops, infrastructure, urban cyclist, music nerd.
Configure DNSimple as your secondary DNS provider to improve your domain's availability and redundancy with AXFR zone transfers.
Get a free limited-edition t-shirt featuring the characters of howdns.works and howhttps.works with any new yearly subscription to DNSimple.