views:

20

answers:

1

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!

+1  A: 
find . -name '*.per' \! -exec grep -q 'connection_id' {} \; -print
Ignacio Vazquez-Abrams
Thank you Ignacio. This isn't working for me. When I execute it, nothing happens. There are about 100 files that are max 1k that should take a couple of seconds to work through but when executed, the prompt isn't returned and no info is shown.
Eric
@Eric: Had a small bug. Should be fine now.
Ignacio Vazquez-Abrams
It worked! :) Thanks.
Eric