title: grep on another file through piped output from one file
body: <p>I am implementing a command</p>
  
  <pre><code> awk '{if($2 == "1")print $1}' file1 
  </code></pre>
  
  <p>the output of which , I would like to pipe to grep on another file, 
  something like</p>
  
  <pre><code> awk '{if($2 == "1")print $1}' file1 | grep to file2
  </code></pre>
  
  <p>However I am unaware of such method existing to pipe a grep to another file, any help would be helpful. Thanks</p>
  
  <p>My file1 looks like this </p>
  
  <pre><code> ENSG00000127527:I11 0
   ENSG00000086015:I6 0
   ENSG00000198336:I7 0
   ENSG00000127527:I12 0
   ENSG00000086015:I7 0
   ENSG00000198342:I1 0
   ENSG00000127527:I13 0
   ENSG00000086015:I8 0
   ENSG00000198342:I2 0
  </code></pre>
  
  <p>and my file 2 is as follows:</p>
  
  <pre><code> chrX   99892102    99893102    ENSG00000000003:I1  -
   chrX   99890744    99890965    ENSG00000000003:I2  -
   chrX   99890250    99890402    ENSG00000000003:I3  -
   chrX   99889027    99890027    ENSG00000000003:I4  -
   chrX   99888537    99888732    ENSG00000000003:I5  -
   chrX   99887566    99887983    ENSG00000000003:I6  -
   chrX   99885864    99886864    ENSG00000000003:I7  -
   chrX   99840145    99840227    ENSG00000000005:I1  +
   chrX   99847620    99848620    ENSG00000000005:I2  +
   chrX   99849145    99849257    ENSG00000000005:I3  +
  </code></pre>