1

How can I use grep and/or find to find all files which have all of specfied words?

So something like

grep -R -words 'Quick', 'Lazy', 'Jumped' /

would return all files on system with words Quick, Lazy and Jumped.

Is there any support or should I be looking to write my own script?

arahant
  • 111
  • You should read the manual pages for the utilities you're asking about. The answer would then become clear. Try man grep for starters. – Thomas N Nov 01 '17 at 21:37
  • @ThomasN: While it’s true that question-askers should read the manual pages for the utilities they’re asking about, your comment is inappropriately snarky. This is a tricky question. Can you provide an answer that’s “clear” from man grep? (No fair peeking at the duplicate.) – G-Man Says 'Reinstate Monica' Nov 02 '17 at 02:30
  • Well, I didn't look at the duplicate, but using the -f switch to provide the pattern(s) to look for and using the -R switch to recursively look from whatever point the poster desires should cover the requirements of the question. Seems like all that would need to be done would be to fiddle with the pattern match. You could use something like ".Quick.Lazy.Jumped.", but you would soon burn through most of your memory and computation power performing that search across an entire machine. More research would probably have helped. – Thomas N Nov 02 '17 at 14:20

0 Answers0