By Tim chase
Dumb CLI trick. Wanted to find files containing all of several terms (dup2, pledge, socketpair, fork), but they could occur anywhere in the file: $
find . -name '*.c' | xargs fgrep -lw dup2 |xargs fgrep -lw pledge | xargs grep -l 'socketpair.*SOCK_STREAM' | xargs fgrep -w fork
Busy today & a bit overwhelmed.
Any ideas. First thing that came to mind was awk but see NB1 above