Q:

How to find file that is missing a required string?

On my OS X command line, I would like to find all files ending in .per that are missing the string 'connection_id'.
How do I go about doing this. Finding the files that have a given string is easy but am not sure how to do this if the string is missing.
Thanks!

A:

find . -name '*.per' \! -exec grep -q 'connection_id' {} \; -print

