How to caseless grep listing names of files containing ALL of several strings and NONE of another several strings
Frequently I want to generate a list of files having the stated condition.
Suppose I want to find all files with a copyright and a main but without using fcntl or a namespace.
Here is a clumsy approach:
fgrep -i -r -l copyright *|xargs fgrep -i -l main|xargs fgrep -i -l -v fcntl|xargs fgrep -i -l namespace
Does anyone know how to achieve the same result with a more sophisticated approach using standard utilities?
For fun, I have begun to write my own C++17 program to achieve a speedy result but I would love to find my own work unnecessary. Here is my GitHub repository with that code: