title: How to find words from one file in another file?
body: <p>In one text file, I have 150 words. I have another text file, which has about 100,000 lines.</p>
  
  <p><em>How can I check for each of the words belonging to the first file whether it is in the second or not?</em></p>
  
  <p>I thought about using <code>grep</code>, but I could not find out how to use it to read each of the words in the original text.</p>
  
  <p>Is there any way to do this using <code>awk</code>? Or another solution?</p>
  
  <p>I tried with this shell script, but it matches almost every line:</p>
  
  <pre><code>#!/usr/bin/env sh
  cat words.txt | while read line; do  
      if grep -F "$FILENAME" text.txt
      then
          echo "Se encontró $line"
      fi
  done
  </code></pre>
  
  <p>Another way I found is:</p>
  
  <pre><code>fgrep -w -o -f "words.txt" "text.txt"
  </code></pre>