What's the ack syntax to find all files containing foo and also bar?
First we need to select the files that contain
foo and, from that list of files, selects files that also contain
ack -l foo | ack -x bar
As you can see, this works in two steps:
ack -l fooproduces a list of the names of files that contain
ack -x barsearches the files named on stdin for the expression