Wednesday, September 2, 2015

Recursively Search for Files Containing One String But Not Another

Building on the answer in StackExchange, here is the way to recursively search for files containing one string but not another:

grep -rL must_have_this_string some/path | xargs grep -l wont_have_this_string

There are other ways, but this works.

No comments: